-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add silution #1067
base: master
Are you sure you want to change the base?
add silution #1067
Conversation
gorbachovam00
commented
Dec 9, 2024
- DEMO LINK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
Please check comments.
src/scripts/main.js
Outdated
// startButton.textContent = 'Restart'; | ||
// updateUI(); | ||
// checkGameStatus(); | ||
// }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not keep commented code
src/scripts/main.js
Outdated
}); | ||
|
||
document.addEventListener('keydown', (event) => { | ||
if (game.getStatus() !== 'IN_PROGRESS') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to constants statuses.
better to palce all statuces strings in object.
src/scripts/main.js
Outdated
'use strict'; | ||
|
||
// Uncomment the next lines to use your game instance in the browser | ||
// const Game = require('../modules/Game.class'); | ||
// const game = new Game(); | ||
|
||
// Write your code here | ||
class Game { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you wrote class Game in main.js?
move code to /modules/Game.class and import here (uncomment code above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost done.
Move to right still add new cell, even when wasn't any move or cells merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.