Post Reply 
(11C) Nimb
09-03-2019, 06:39 AM (This post was last modified: 09-03-2019 07:36 AM by NoEqualsButton.)
Post: #1
(11C) Nimb
Nimb for the 11C. Why not? This program 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:

001  f FIX 0
002  1
003  5
004  STO 0
005  f LBL 0
006  RCL 0
007  R/S
008  f x>y 
009  GTO 0    # move > value
010  3
011  x<->y
012  f x>y
013  GTO 0 # Move bigger than 3
014  0
015  x<->y
016  f  x<=y 
017  GTO 0    # move LEQ 0
018  RCL 0
019  x<->y
020  STO-0    # Player move
021  RCL 0
022  g x<>0 
023  GTO 1
024  5
025  5
026  1
027  7
028  8
029  g RTN    # BLISS, Program wins
030  f LBL 1
031  1    # Compute program move
032  -
033  4
034  /
035  f FRAC
036  4
037  *
038  g x=0 
039  1
040  STO-0    # Program move
041  f PSE
042  RCL 0
043  g x<>0 
044  GTO 0
045  3    
046  5
047  0
048  7
049  .
050  1
051  f FIX 1
052  g 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)