Post Reply 
(11C) Code guessing game
04-28-2018, 12:24 PM (This post was last modified: 04-28-2018 05:42 PM by Rogier.)
Post: #8
RE: (11C) Code guessing game
Thanks for the help on the "code" tag. I'll try it with another program.

As to my scoring routine: I slice off digits from code and guess and compare them. If they are equal, I add 1 to the score, if the integer part of (log [remaining part code] - log [remaining part guess]) = 0 then the digits are in the same place and I add 0,1 tot the score. What the program doesn't do, is check is whether a number in your guess has already been examined.

So:
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

Code = 445
Guess = 411 > 1,1 One digit correct and in the right place

I give a bit more information than Mastermind rules, but with 10 places, 9 colours it's still quite a challenge. (And time-consuming; scoring 10 digits takes 2min24sec to 2min54sec on my HP-11C. Touch 11i free on my phone is even slower. Plus: it displays the X-register during program execution, which is a bit of a spoiler, because that shows you the code.)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) Code guessing game - Rogier - 04-25-2018, 06:18 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 - 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



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