(17BII) Mastermind
|
04-30-2020, 08:45 PM
(This post was last modified: 04-30-2020 08:51 PM by Nihotte(lma).)
Post: #1
|
|||
|
|||
(17BII) Mastermind
This time, it's a function for the HP17BII to search Mastermind code
I think my formula needs to be modify to run on the HP17BII+ because i use some multiply by 0 But it could run on HP27S too The formula is close to the mechanism in use for the program running on the 12C You should see the 3 steps : 1) generates the code to break (MIND) when N is 0 2) search for black positions between MIND and N (the user attempt) and prepares the white step 3) search for white positions among the remaining non black positions There is the code : Code:
Example of use : [CALC] → [EVAL] [ N ] [ NIVO ] [ RAN# ] [ MIND ] [ NB ] DSP [ FIX ] 2 INPUT ,123456789 [RAN#] 5 [NIVO] 0 [N] [EVAL] → EVAL=0,00 12399 [N] [EVAL] → EVAL=12399,05 : 0 black position but 5 white positions 99321 [N] [EVAL] → EVAL=99321,32 : 3 black positions and 2 white positions 93921 [N] [EVAL] → EVAL=93921,50 : all 5 positions found RCL [NB] → NB=3,00 after 3 attempts 0 [N] [EVAL] → EVAL=0,00 xxxxx [N] [EVAL] and so on |
|||
04-30-2020, 10:08 PM
Post: #2
|
|||
|
|||
RE: (17BII) Mastermind
I left my 17BII at the office before being locked down...
Juste because I’m curious: Are you using a special mean to avoid being confused with all these parenthesis? How much time did you spend for stabilizing the equation? |
|||
05-01-2020, 07:34 AM
(This post was last modified: 05-01-2020 07:39 AM by Nihotte(lma).)
Post: #3
|
|||
|
|||
RE: (17BII) Mastermind
(04-30-2020 10:08 PM)pinkman Wrote: I left my 17BII at the office before being locked down... Hello pinkman ! That's right ! the system with all this parenthesis is not really easy. After the first formula entry in the calculator, you can be sure you receive a INVALID EQUATION when pressing [CALC] !!! But when you have made LISP program at school, that's a good training way !... To control the equation, on the paper, i put a number under each pair of parentheses from the easy (and the very close) to the most distant. So i begin with the G( ) or L( ) and i put a 1 - 1 under each parenthesis and i finalize with the initial IF( and the ending )... I mean, you are right : this step of validating the parentheses is the most painful and stressful! And this is just a first step because you should have to play with the order of the variables on the the display... But after all, when you run the formula, it's a little mixture of surprise and satisfaction ! Does anyone else have a specific approach to finalize all of these steps?! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)