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.
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!
@bcostello I see, I did specify that there will be no repeated numbers so that normally wouldn't be a problem. I couldn't figure out how to do it otherwise with the time frame I had. I also just realized that I do specify that I need a number between 1 and 10 in which you should never enter a 0, but that means they could also enter the number 10, which isn't what I meant by that. It should be fixed now.
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.