(11C) Code guessing game
|
04-29-2018, 09:58 PM
(This post was last modified: 04-29-2018 10:31 PM by Rogier.)
Post: #12
|
|||
|
|||
RE: (11C) Code guessing game
Michealzinn, I'll try and add more comments to other programs, but since I wrote most of my programs over 30 years ago, you're not the only one having problems understanding the structure. At the time I was more interested in how to operate the programs than in documenting how they work.
Dieter, about the scoring: I compare each digit of the code to the last digit of the guess, then I divide the guess by 10 and repeat the procedure until the guess is all sliced up. The scores I quoted are correct (at least: as intended within the parameters of the program): Code = 451 Guess = 112 > 2,0 Two digits correct, not in the right place Guess = 111 > 3,1 All correct, one in the right place If the code were 333, a guess of 333 should score 3,3; 3 digits correct, all of which in the right place. You never see that, but entering 3333 yields 4,3. (I don't check for the right length when you enter a guess. Would be relatively easy to fix of course.) I'll have to adapt your program by the way Sto/,0 doesn't work on an HP-11c. Pier4r: I have thought about reversing the roles and let the calculator guess, but gave up on it. Not a chance of fitting it in an HP-11c, and too complex (at least for me) to program it in my ZX-Spectrum or in GW-basic. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)