Casio Calculators:Programs:Master Mind
Master Mind



Program: Master Mind
Size: small
Models: all
Author: Ian M. Klassen
Description: It is a Master Mind program. You have to figure out what the number is that the program picked. The range of numbers is from 11111 to 99999. You are prompted to enter your number. If you entered a number that is too long or too short (must be five digits) then the program will ask you for your number again. Once you enter your number the program will tell you how many numbers you have correct in the correct positions. For example, if the correct number was 12345 and you picked 52387 you would get two numbers correct.

If you wanted you could also get the program to tell you how many numbers you have correct, but in the wrong positions. I found that that was too easy so I took it out.


"MASTER MIND"
Norm
0->T
Int 9Ran#+1->A
Int 9Ran#+1->B
Int 9Ran#+1->C
Int 9Ran#+1->D
Int 9Ran#+1->E
Lbl 1
T+1->T
0-->R
"ENTER NUMEER"?->N
Int (N\10/\4)->V
V=0=>Goto 1
V>9=>Goto 1
Int (N/10/\3)-l0V->W
Int (N/10/\2)-100V-10W->X
Int (N/10)-1000V-100W-l0X->Y
N-10000V-1000W-100X-10V->Z
V=A=>R+1->R
W= B=> R+1-> R
X=C=>R+1->R
Y=D=>R+l->R
Z=E=>R+1->R
"NUMBER RIGHT:"
R_
R<5=>Goto 1
" "
" "
"RIGHT ON!"
"NUMBER OF TRIES:"
T_
" "