My Version of Bulls and Cows

Here is my version of Bulls and Cows:

GitHub Code

I have changed the way the hidden word is taken so that it has more than 1. So i created a TMap list type that i store some const words that follow the rules of course and then i choose one randomly to play with. After the game is ended the Reset function just picks another word that hasn’t already being played and so on. Until there are no more words to play with so that the question to play again doesn’t show up. Instead a message of congrats appears and the game is over for good :stuck_out_tongue:

I like it.

Just some thoughts that your “so that the question to play again doesn’t show up” made me think of.

As long as the console can be exited as in that case you don’t need to end with the play again question as often as they had chosen. In any case, even their way doesn’t allow a person to exit at any moment naturally via the game.

An alternative for natural exiting is to allow all input to accept “quit” (and filter that out of the game) or even “q!”, etc so the user can always exit naturally.

As when you play a regular game you can press esc and exit so same principal.

But great job :smile:

Privacy & Terms