So as all of you know, Cows and Bulls is a pen and paper adaptation of the popular board game Mastermind. I would like to design a game that would allow duplicate numbers for the code and assign perhaps a third variable called "milk" to ascertain the number of repetitions in the code.

We will be playing with five digits instead of four, so what exactly would be the guidelines we would have to follow in order to accommodate "milk" as an additional parameter? Please explain with examples as well.


If you are allowing 5 digits then you can have two different kinds of repetitions. That is, you could have a code like 11122, so this should probably be represented somehow such that the ”milk” is different from the 11111 case.

Since you can have at most two repetition groups, it seems like the easiest thing to do would be to have another variable, (cans of milk vs buckets of milk?) for the second repetition group, if any.

Another thing to consider is what values of the milk variable should indicate which amount of repetitions. 1 milk for 1 repetition, (11234 for example,) and two milks for two, (11123) makes sense from a certain point of view, but having two milks mean two values are the same, (11234) three for three values that are the same, (11123) and the milk being ignored otherwise might be more intuitive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.