Post Reply 
(25) Nimb
09-03-2019, 06:55 AM (This post was last modified: 09-03-2019 07:35 AM by NoEqualsButton.)
Post: #1
(25) Nimb
Nimb for the HP 25. 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

Code:

01  f FIX 0
02  1
03  5
04  STO 0
05  RCL 0
06  R/S
07  x<->y
08  f x<y 
09  GTO 05  # move GT value
10  x<->y
11  3
12  f x<y
13  GTO 05 # Move bigger than 3
14  CLx
15  f x>= y
16  GTO 05    #move LEQ 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

Steve

HP11C, HP12C, HP15C, HP16C, HP25, HP32S, HP33C, HP41CV, DM42, HP46, HP65
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)