HP Forums
(11C) Nimb - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (11C) Nimb (/thread-13580.html)



(11C) Nimb - NoEqualsButton - 09-03-2019 06:39 AM

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