Cows and Bulls guessing game

(Fixed multiple issues)

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.

https://repl.it/@RonanJones/Bulls-and-Cows-Guessing-Game

Very fun for him. Thanks!

@bcostello I see, tell your student good job from me.

It doesn't appear that this game works. Just FYI.

@bcostello What doesn't work on it? I have a feeling I made it a little confusing with the instructions.

@TristanArmstron Sorry, my comment was vague and not helpful! Technically it does work, but let's say the number is 5512. If we enter 5500, we get 2 cows and 2 bulls. I see why, but 2 cows and 0 bulls seems to make more sense.

@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.

@TristanArmstron We did have an answer with a repeated number. Is that what you fixed?

@bcostello It should be yes

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.

@Sdcrouse Thanks for reporting it. I fixed it by making it print another "enter" after.

@TristanArmstron Excellent! That works.

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.