HP Forums
(12C) Mastermind on HP12c - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (12C) Mastermind on HP12c (/thread-14743.html)



(12C) Mastermind on HP12c - Nihotte(lma) - 03-29-2020 08:07 PM

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


RE: Mastermind on HP12c - Nihotte(lma) - 04-10-2020 12:35 PM

The same listing for HP12C with included example
(Thank you for you practical note, rprosperi)