-
Notifications
You must be signed in to change notification settings - Fork 530
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
added logic for bulls and cows game #247
base: master
Are you sure you want to change the base?
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! but check the comment below
src/randomizer.js
Outdated
|
||
function getRandomFourDigitNumber() { | ||
const min = 1000; | ||
const max = 9999; | ||
|
||
return Math.floor(Math.random() * (max - min + 1)) + min; |
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.
- the program randomly generates a number of 4 different digits
but in your case - random number can be with the same digits (for ex. 4455 or 6600)
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! Couple of issues in comments)
src/app.js
Outdated
terminal.question(`Please guess the number (four digits): `, (userNumber) => { | ||
/* eslint-disable no-console */ | ||
|
||
if (userNumber.toString().length < 4) { |
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 if userNumber will be longer?
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 👍
No description provided.