09-03-2019, 05:08 AM
Nimb for the 12C! Only allows values between one and three ( or value left ). No cheating allowed. Fun with only 2 conditional tests!
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]
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 1 | 1
02 5 | 5
03 STO 0 | 44 0
04 RCL 0 | 45 0
05 R/S | 31
06 g x<=y | 43 34
07 GTO 09 | 43,33 09
08 GTO 04 | 43,33 04 # move GT value
09 3 | 3
10 x<->y | 34
11 g x<=y | 43 34
12 GTO 14 | 43,33 14
13 GTO 04 | 43,33 04 # Move bigger than 3
14 0 | 0
15 x<->y | 34
16 g x<=y | 43 34
17 GTO 04 | 43,33 04 #move LEQ 0
18 STO-0 | 44 30 0 # Player move
19 RCL 0 | 45 0
20 g x=0 | 43 35
21 GTO 23 | 43,33 23
22 GTO 29 | 43,33 29
23 5 | 5
24 5 | 5
25 1 | 1
26 7 | 7
27 8 | 8
28 GTO 00 | 43,33 00 # BLISS, Program wins
29 1 | 1 # Compute program move
30 - | 30
31 4 | 4
32 / | 10
33 g FRAC | 43 24
34 4 | 4
35 * | 20
36 g x=0 | 43 35
37 1 | 1
38 STO-0 | 44 30 0 # Program move
39 g PSE | 43 31
40 RCL 0 | 45 0
41 g x=0 | 43 35
42 GTO 44 | 43,33 44
43 GTO 04 | 43,33 04
44 3 | 3
45 5 | 5
46 0 | 0
47 7 | 7
48 . | 48
49 1 | 1 # 1.LOSE, Program looses
50 GTO 00 | 43,33 00