How about a "guess the number 0-99" program for the 17b (and 17bii) solver.
At first glance, you would think it might not be possible due to: lack of a random number function, lack of alpha messages to tell you if you are too high or too low, and lack of a "beep" instruction when you correctly guess the number. Plus, the 17b is not programmable, right?
Lack of random number function is overcome by using current time (minutes, seconds) and the MOD function. Lack of alpha capability is overcome by returning -1 if your guess is too low and 1 if it is too high (yes, it's not ideal, but it works). A "beep" is generated by doing a Log(0) which generates an error message and halts evalution of the equation (AFTER saving the number of guesses in variable GUESS so it can be recalled).
The equation works on the 17b and 17bii. It mostly works on the 17bii+ except the number of guesses is wrong due to the way the solver in the 17bii+ works (or doesn't work, actually).
Press INIT a couple of times (not sure why that is necessary) then enter your guess and press GUESS. Then press EVAL to evaluate your guess: -1 means you are too low, 1 means you are too high, and a beep means you guessed the number so do a RCL GUESS to see the number of guesses it took.IF(S(INIT):
L(G:0)X
L(N:MOD(10000XFP(CTIME)X111:100))
-INIT
:
0XL(G:G(G)+1)+
IF(GUESS=G(N):
L(GUESS:G(G))+
LOG(0)
:
IF(GUESS>G(N):1:-1)
)
-EVAL
)
What is the maximum number of guesses it should take to identify the number from 0 to 99?
Edited: 7 June 2011, 8:31 p.m. after one or more responses were posted