HP Forums

Full Version: (12C) Mastermind on HP12c
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
There is my first post for the MoHPC

I wrote this program of Mastermind for the HP12c because it's become my usual calculator at work
I had to adapt my original program, initially written for calculators like HP15c and HP41c... So, I adopted a new way !

This is :

- first period with the creation of the code to break (5 digits from 1 to 9)
- entry of the attempt to find the code
- second period with the comparison digit by digit between the code to break and the entry. Black positions to win ! In the same time, creation of 2 virtual arrays (code to find // attempt) of digits with the non-black digits.
- third period to assimilate the active positions in the 2 arrays. White positions in win !
- gives back the result and waits for a new attempt
The same listing for HP12C with included example
(Thank you for you practical note, rprosperi)
Reference URL's