Cows and Bulls
Cows and Bulls guessing game
(Fixed multiple issues)
Enter a whole number between 1 and 9: 7
Enter a whole number between 1 and 9: 4
Enter a whole number between 1 and 9: 9
Enter a whole number between 1 and 9: 5
One of the numbers is not a whole number between 1 and 9. Please try again
Your guess: [7, 4, 9, 5]
The error message is displayed no matter what.
I see why it's possible to get repeated numbers.
The code ensures that Rand1 is not equal to 2,3 or 4. But the next while loop allows Rand2 to be changed and doesn't check it against Rand 1.
I had a student re-work the game. Here is the link.
Very fun for him. Thanks!
This is good, but the "Restart" bar blocks the line that tells me how many guesses it took me to get the right number, at least in my Chrome browser.