09-03-2019, 08:10 AM
Nimb for the HP 33C. This version does not allow cheating.
Usage:
f PRGM R/S < initial value is 15 >
Loop:
Display remaining value
< Enter 1 2 or 3 >
R/S
If you took remaining value then display 55178 ( BLISS ) and halt
Displays program move briefly ( 1,2 or 3)
If program took remaining value then display 3507.1 ( I.LOSE ) and halt
Loop back to start
Usage:
f PRGM R/S < initial value is 15 >
Loop:
Display remaining value
< Enter 1 2 or 3 >
R/S
If you took remaining value then display 55178 ( BLISS ) and halt
Displays program move briefly ( 1,2 or 3)
If program took remaining value then display 3507.1 ( I.LOSE ) and halt
Loop back to start
Code:
01 f FIX 0
02 1
03 5
04 STO 0
05 RCL 0
06 R/S
07 f x>y
08 GTO 05 # move GT value left
09 3
10 x<->y
11 f x>y
12 GTO 05 # move GT 3
13 g x>0
14 GT0 16
15 GT0 05 # move LEQ 0
16 RCL 0
17 x<->y
18 STO-0 # Player move
19 RCL 0
20 g x<>0
21 GTO 28
22 5
23 5
24 1
25 7
26 8
27 GTO 00 # BLISS, Program wins
28 1 # Compute program move
29 -
30 4
31 /
32 g FRAC
33 4
34 *
35 g x=0
36 1
37 STO-0 # Program move
38 f PAUSE
39 RCL 0
40 g x<>0
41 GTO 05
42 3
43 5
44 0
45 7
46 .
47 1 # 1.LOSE, Program looses
48 f FIX 1
49 GTO 00