Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

solution #241

wants to merge 3 commits into from

Conversation

IzzetYusufov
Copy link

No description provided.

Copy link

@maxim2310 maxim2310 left a 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)

Comment on lines 12 to 13
digits = digits.slice(0, randomDigitIndex)
+ digits.slice(randomDigitIndex + 1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) {

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)) {

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

Copy link

@anastasiiavorobiova anastasiiavorobiova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants