-
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
Solution #29
base: master
Are you sure you want to change the base?
Solution #29
Conversation
serhii-web
commented
Apr 7, 2021
- DEMO LINK
src/scripts/main.js
Outdated
createRandomNumber(); | ||
createRandomNumber(); |
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.
maybe pass argument inside?
createRandomNumber(2) // generates two random numbers
createRandomNumber(4) // generates four random numbers
createRandomNumber() // generates one random number
src/scripts/main.js
Outdated
@@ -1,3 +1,254 @@ | |||
'use strict'; | |||
|
|||
// write your code here | |||
|
|||
const button = document.querySelector('button'); |
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.
whicch exact button you're getting here? Maybe use class to select exact button?
} | ||
|
||
function createRandomNumber() { | ||
const number = [2, 4][+(Math.random() > 0.9)]; |
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
src/scripts/main.js
Outdated
})); | ||
} | ||
|
||
function cleareBoard() { |
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.
function cleareBoard() { | |
function clearBoard() { |
src/scripts/main.js
Outdated
if (tap.key === 'ArrowRight') { | ||
moveRight(); | ||
} | ||
|
||
if (tap.key === 'ArrowLeft') { | ||
moveLeft(); | ||
} | ||
|
||
if (tap.key === 'ArrowDown') { | ||
moveDown(); | ||
} | ||
|
||
if (tap.key === 'ArrowUp') { | ||
moveUp(); | ||
} |
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
src/scripts/main.js
Outdated
} | ||
|
||
function moveRight() { | ||
moveInRingthDirection(); |
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.
what is Ringth
?