Talk:Bulls and cows

From Rosetta Code
Revision as of 03:57, 29 January 2012 by Markjreed (talk | contribs) (→‎Scoring)

Scoring

The scoring algorithm gets more interesting if duplicate digits are permitted... —Dkf 09:54, 20 May 2009 (UTC)

You might try first checking for Bulls, and 'crossing-out' any found, then checking for cows in the remainder? (But the increased complexity in interpreting the score might make the game worse to play). --Paddy3118 20:09, 20 May 2009 (UTC)
My understanding is that Bulls and Cows traditionally disallows repeated digits. However, the similar commercial board game Mastermind does allow duplicates. The way scoring works there, you get credit for at most one bull (black peg) or cow (white peg) per digit in the solution (not in the guess). So if the code is 1122 and you guess 1112, you get three bulls (for the first two 1's and the 2), but no cow for the third 1, because both 1's in the code are already accounted for.

-- Markjreed 03:53, 29 January 2012 (UTC)