-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
game #425
base: master
Are you sure you want to change the base?
game #425
Conversation
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! Let's improve your code a bit!
src/scripts/main.js
Outdated
randomCellFill(); | ||
}; | ||
|
||
function isMergePossible() { |
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.
You used arrow functions above and function declaration here.
Stay strict to one way of creating functions for concise and readable code
src/index.html
Outdated
</body> | ||
|
||
</html> |
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.
</body> | |
</html> | |
</body> | |
</html> |
Don't leave empty lines between parent and child elements
case 'ArrowLeft': | ||
arrowLeft(); | ||
break; |
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.
switch...case should always have a default case to handle possible errors
src/scripts/main.js
Outdated
|
||
function rotateCells(line) { | ||
for (let i = 3; i > 0; i--) { | ||
const moveAllowed = clearCells.includes(line[i]) |
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.
Well done 🔥
DEMO LINK](https://diana-tuz.github.io/js_2048_game/)