Talk:Bulls and cows: Difference between revisions

what to do with 1112.
(→‎malformed numbers: added another comment regarding cloudy logic and low blood sugar thinking. -- ~~~~)
(what to do with 1112.)
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)
 
----
Version 2 rejects guesses with repeated digits. I understood the task that way. Don't you?
--[[User:Walterpachl|Walterpachl]] 05:11, 5 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)
 
:Hmm. Thanks for the info on the variants where you introduce a placeholder not-a-number symbol. I guess it cannot match anything and would serve to reduce complexity when someone wants to test what they think they may know about a partial solution?
:If I were playing with more digits then I guess it would allow me to reduce the problem to something I could work out in my head. --[[User:Paddy3118|Paddy3118]] 03:00, 5 July 2012 (UTC)
 
:: Yes, anything not a digit (in this case) doesn't match anything. It's very helpful when your mind is a bit cloudy (like enjoying some down-time after an eighteen hour coding tear), or maybe you're dealing with a "bulls and cows" game variant with more than four digits. Also, kids like to use a NaN guess as they seem to prefer to deal with a smaller subset of logic. Well, ok, ok, so do I at times. I was playing a few games as I always check out the game after I make a change (or an improvement, ha!), and once, I just couldn't find a solution (I had zigged instead of zagged when coding a change), and the "cows" information was wrong. I had to ignore the cows and try only for the bulls. -- [[User:Gerard Schildberger|Gerard Schildberger]] 03:12, 5 July 2012 (UTC)
 
==REXX version 2==
2,289

edits