Post Reply 
Surprise graphic program (HP-48G, GX)
10-28-2014, 07:21 AM (This post was last modified: 10-28-2014 07:00 PM by Gerson W. Barbosa.)
Post: #1
Surprise graphic program (HP-48G, GX)
Here is a simple graphic program for the HP-48G,GX (it should work on the HP-49G and hp 50g also). No fancy program, but in theory it obeys a physical principle, if I haven't made any mistake (I'll explain later). 787 bytes, but it can be easily optimized for size.

Code:

%%HP: T(3)A(D)F(.);
\<< # 131d # 63d
BLANK PICT STO 66
125
  FOR c c 66 - \v/
NEG 8 + 4 * R\->B c
R\->B SWAP OVER NEG
131 + OVER NEG 63 +
4 PICK OVER 4 PICK
6 PICK 2 \->LIST
PIXON 2 \->LIST PIXON
2 \->LIST PIXON 2
\->LIST PIXON
  NEXT { # 0d # 0d
} { # 130d # 63d }
BOX { # 125d # 0d }
{ # 125d # 63d }
LINE { # 6d # 0d }
{ # 6d # 63d } LINE
7 65
  FOR c c NEG 65 +
\v/ NEG 8 + 4 * R\->B c
R\->B SWAP DUP2 NEG
63 + 2 \->LIST ROT
ROT 2 \->LIST LINE
  NEXT { # 0d # 0d
} PVIEW 2 WAIT 7 64
  FOR c c NEG 65 +
\v/ NEG 8 + 4 * 1 +
R\->B c R\->B SWAP DUP2
NEG 63 + OVER NEG
131 + DUP2 6 PICK 2
\->LIST ROT ROT 2
\->LIST LINE 2 \->LIST
ROT ROT 2 \->LIST
TLINE { # 0d # 0d }
PVIEW .5 WAIT
  NEXT { # 0d # 0d
} PVIEW
  DO
  UNTIL KEY
  END DROP
\>>

P.S.: Place the calculator in landscape position.

P.P.S.: Edited to fix code

c NEG 65 + \v/ NEG 8 + 4 * 1 +

not

c NEG 65 + \v/ NEG 8 + 4 * 1 -

in the beginning of the last loop.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Surprise graphic program (HP-48G, GX) - Gerson W. Barbosa - 10-28-2014 07:21 AM



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