Talk:Bulls and cows: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Scoring: request clarification of form of target (0's/duplicates allowed?))
Line 3: Line 3:
: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). --[[User:Paddy3118|Paddy3118]] 20:09, 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). --[[User:Paddy3118|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.
::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.
-- [[User:Markjreed|Markjreed]] 03:53, 29 January 2012 (UTC)
::-- [[User:Markjreed|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 [http://en.wikipedia.org/wiki/Bulls_and_cows Wikipedia] - and most of the solutions on this page - allow zeroes. Also, the description should probably specify whether or not repeated digits are allowed.
-- [[User:Markjreed|Markjreed]] 00:20, 31 January 2012 (UTC)

Revision as of 00:20, 31 January 2012

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)