-
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
solution #241
base: master
Are you sure you want to change the base?
solution #241
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.
Great job overall! Just couple tiny things needs to be fixed before approval)
src/numberGenerator.js
Outdated
digits = digits.slice(0, randomDigitIndex) | ||
+ digits.slice(randomDigitIndex + 1); |
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.
digits = digits.slice(0, randomDigitIndex) | |
+ digits.slice(randomDigitIndex + 1); | |
digits = digits.splice(randomDigitIndex, 1) |
src/app.js
Outdated
|
||
const result = calculateBullsAndCows(secretNumber, guessedNumber); | ||
|
||
if (result.bulls === 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.
need to add congratulation message
src/app.js
Outdated
|
||
function playGame() { | ||
rl.question('Enter your guess: ', (guessedNumber) => { | ||
if (guessedNumber.length !== 4 || !/^\d{4}$/.test(guessedNumber)) { |
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.
4 is a 'magic number', so make sense to move it to the constant
check other places
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 work!
No description provided.