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 1 #230

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

Solution 1 #230

wants to merge 1 commit into from

Conversation

JohnRust12
Copy link

No description provided.

Copy link

@lerastarynets lerastarynets 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! Left a few comments to make your code more advanced)


const result = getBullsAndCows(userInput, randomDigits);

if (result === 'bull bull bull bull') {

Choose a reason for hiding this comment

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

Checking for 'bull bull bull bull' is not efficient or scalable. Consider returning a count of bulls and checking if it equals 4.

@@ -0,0 +1,21 @@
'use strict';

function check(userNum, randomNum) {

Choose a reason for hiding this comment

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

The function should return the number of bulls and cows, not an array with '*' and 'bull' or 'cow'. Consider changing the result format.

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