-
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
Develop #1092
base: master
Are you sure you want to change the base?
Develop #1092
Conversation
nex1994
commented
Dec 21, 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.
Great job on implementing the 2048 game! 🎉 The code meets the task requirements and constraints, and the game functions as expected. Just make sure to correct the typo in the Game
class method name from addRandomTitle
to addRandomTile
to prevent any runtime errors. Keep up the excellent work and happy coding! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
} | ||
|
||
if (moved) { | ||
this.addRandomTitle(); |
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 seems to be a typo in the method name addRandomTitle
. It should likely be addRandomTile
to reflect the action of adding a random tile to the board.
|
||
start() { | ||
this.status = 'playing'; | ||
this.addRandomTitle(); |
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.
Same typo as above: addRandomTitle
should be addRandomTile
.
start() { | ||
this.status = 'playing'; | ||
this.addRandomTitle(); | ||
this.addRandomTitle(); |
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.
Same typo as above: addRandomTitle
should be addRandomTile
.
|
||
startButton.addEventListener('click', () => { | ||
if (startButton.classList.contains('start')) { | ||
game.start(); |
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.
Ensure that the start
method in the Game
class correctly initializes the game state. There was a typo in the Game
class regarding the method name addRandomTitle
, which should be addRandomTile
. Make sure this is corrected in the Game
class to avoid runtime errors.