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

added logic for bulls and cows game #247

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

Conversation

voievodik
Copy link

No description provided.

Copy link

@DenisChakhalian DenisChakhalian left a 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

Comment on lines 2 to 7

function getRandomFourDigitNumber() {
const min = 1000;
const max = 9999;

return Math.floor(Math.random() * (max - min + 1)) + min;

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)

Copy link

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

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?

Copy link

@ArtemTeslenko ArtemTeslenko left a comment

Choose a reason for hiding this comment

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

Great 👍

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.

3 participants