Talk:Bulls and cows

From Rosetta Code
Revision as of 00:20, 31 January 2012 by Markjreed (talk | contribs) (→‎Scoring: request clarification of form of target (0's/duplicates allowed?))

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)

Form of target number

The description says that the digits must be from the set 1 through 9, but Wikipedia - and most of the solutions on this page - allow zeroes. Also, the description should probably specify whether or not repeated digits are allowed. -- Markjreed 00:20, 31 January 2012 (UTC)