Shoutbox

Cows and bulls programme - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Cows and bulls programme (/showthread.php?tid=55360)

Cows and bulls programme by Rubber Stamp on 01-29-2006 at 01:28 PM

can someone please help write a c++ programe for a cows and bulls game??
the game is something like this:


***A bull is a symbol in the guess that matches a symbol of the code both by position and value.
A cow is a symbol in the guess that matches one of the code by value, but not by a position.
example:
the code is : ROYY
yhe guess is: RYBR
then the score would be one bull ( R ) and one cow( Y ).

the program must read some guesses and thier scores.
and output all the codes consistent with the sequence of guesses and responses:
if we enter:
RRRR 2 0
RRBB 2 2

the program must output:
RBRB
RBBR
BRRB
BRBR****

i got the above rules frm some other side. but i dont want the game to be run with letters but numbers, using simple loops and the randomize function.

Thanx.


RE: Cows and bulls programme by saralk on 01-29-2006 at 05:18 PM

I don't understand the second bit, can you explain that again?


RE: Cows and bulls programme by ShawnZ on 01-29-2006 at 06:13 PM

So a bastardized version of mastermind then?