(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
 Rogier Junior Member Posts: 35 Joined: Mar 2018
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.

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 »

 Messages In This Thread (11C) Code guessing game - Rogier - 04-25-2018, 06:18 PM RE: (11C) Code guessing game - Michael Zinn - 04-25-2018, 08:50 PM RE: (11C) Code guessing game - Michael Zinn - 04-25-2018, 10:58 PM RE: (11C) Code guessing game - Dieter - 04-26-2018, 06:57 PM RE: (11C) Code guessing game - Rogier - 04-26-2018, 10:10 PM RE: (11C) Code guessing game - Dieter - 04-27-2018, 06:54 AM RE: (11C) Code guessing game - Dieter - 04-27-2018, 12:52 PM RE: (11C) Code guessing game - Michael Zinn - 04-28-2018, 07:10 PM RE: (11C) Code guessing game - Rogier - 04-28-2018, 12:24 PM RE: (11C) Code guessing game - Dieter - 04-29-2018, 09:00 PM RE: (11C) Code guessing game - pier4r - 04-28-2018, 07:23 PM RE: (11C) Code guessing game - Rogier - 04-29-2018 09:58 PM RE: (11C) Code guessing game - Dieter - 04-30-2018, 08:11 AM RE: (11C) Code guessing game - Rogier - 04-30-2018, 07:29 PM RE: (11C) Code guessing game - SlideRule - 07-23-2018, 03:22 PM RE: (11C) Code guessing game - Rogier - 05-02-2018, 06:49 PM RE: (11C) Code guessing game - Thomas Klemm - 07-23-2018, 01:14 AM RE: (11C) Code guessing game - Nihotte(lma) - 05-31-2020, 07:43 PM

User(s) browsing this thread: 1 Guest(s)