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

add solution #442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

an-marryKyslenko
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor 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 on implementing the Bulls and Cows game! 🎉 Your code meets the core requirements and functions as expected. While there are a couple of minor improvements suggested, such as allowing multiple guesses and removing unnecessary conversions, these do not impact the overall functionality. Keep up the good work and consider these enhancements for future projects! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +21 to +22
console.log(`Your input: ${+userInput}`);
console.log(`Number to guess: ${+numberToGuess}`);

Choose a reason for hiding this comment

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

The unary + operator is used here to convert userInput and numberToGuess to numbers, but they are already numbers. This conversion is unnecessary and can be removed.

} else {
console.log('Invalid input. Please enter a valid number.');
}
rl.close();

Choose a reason for hiding this comment

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

Closing the readline interface here ends the game after the first guess. To allow the user to make multiple guesses until they find the correct number, consider restructuring the code to keep the interface open until the correct number is guessed.

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.

2 participants