Talk:Bulls and cows: Difference between revisions

added a pedigree of an older "Bulls and Cows" game program. -- ~~~~
m (→‎Scoring: clarified the wording. -- ~~~~)
(added a pedigree of an older "Bulls and Cows" game program. -- ~~~~)
Line 4:
::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)
 
::: This is the methodology that the REXX program (version 1) uses. It just takes a little generic programming to accomplish. -- [[User:Gerard Schildberger|Gerard Schildberger]] 22:53, 4 July 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 some 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)
 
==malformed numbers==
 
The task didn't elaborate on what a ''malformed'' guess was, but when I programmed a version (cough-cough, 31 years ago), the user was allowed to guess such things as:
* 12x5
* ..79
* 4 5 7 9
* 7 , , 4
* 42?9
 
Very inexperience beginners (and most children, see below) begin learning the logic of the game by guessing:
* 1111
* 2222
* 3333
* 5
* 79
until they've found four digits that are in the number, and then narrow it down with their own perculiar logic.
 
The (original) program was intentionlly written to allow these forms of guesses and reasoning (logic). It was a goal of the program to not to force any sort of logic or restrictive rules upon the guesser. If the guesser could think it, it was allowed.
 
I added program logic to the REXX (version 1) program, if only to comply to what ''malformed'' could mean.
 
The original program also allowed any number of ''digits'', and also allowed specification of what ''digits'', so that it could mimic the game ''Master Mind'', a popular game of that time. This was the default mode.
 
A comment on the program's pegigree: quite a few of the supervisors were allowed to have a (CRT) terminal at home (for working after hours of course), and as a result, their kids could get on-line and play, which back then, it was quite a treat to play on a computer, and this was before home computers were common. Even at that, home computers were NOT cheap. Of course, it was against the company rules to use a company computer for such non-business thingys, but almost all the computers much very much idle after-hours and on weekends, of course. When asked by my 2nd level supervisor, I glady wrote some games on my own time in EXEC2, a language on the VM/CMS system. And who wanted to throw rocks at one's own bosses? -- [[User:Gerard Schildberger|Gerard Schildberger]] 23:35, 4 July 2012 (UTC)
 
==REXX version 2==