(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.) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)