Post Reply 
(65) Nimb
09-03-2019, 07:06 AM (This post was last modified: 09-05-2019 12:37 AM by NoEqualsButton.)
Post: #1
(65) Nimb
Nimb for the HP65. Only allows values between 1 and 3, no cheating!
Usage:

A

< 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 ( 1,2 or 3). Press R/S to continue.
If program took remaining value then display 3507.1 ( I.LOSE ) and halt
Loop back to start

Code:

LBL A
DSP .0  
1
5
STO 1
LBL 0
RCL 1
R/S
g x>y 
GTO 0    #Move > counter ?
3
x<->y
g x>y
GTO 0 # Move bigger than 3
0
x<->y
g x<=y 
GTO 0    # Move less than or equal to 0
STO-1    # Player move
RCL 1
0
g x<>y
GTO 1
5
5
1
7
8
RTN  # BLISS, Program wins
LBL 1
x<->y
1    # Compute program move
-
4
/
f-1 INT
4
*
0
g x=y
1
x<->y
x<->y
STO-1   # Program move
R/S 
RCL 1
0
g x<>y 
GTO 0
3    
5
0
7
.
1
DSP  .1
RTN    # LOSE, Program looses

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)