Post Reply 
Surprise graphic program (HP-48G, GX)
10-28-2014, 05:07 PM (This post was last modified: 10-28-2014 06:31 PM by Gerson W. Barbosa.)
Post: #4
RE: Surprise graphic program (HP-48G, GX)
(10-28-2014 03:16 PM)Dave Britten Wrote:  Also seems to work on the 48SX.

Thanks! So the revised 48G/GX code should run also on the HP-48S/SX:

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
\>>

That's the exact shape ( y = x^4 ) so that the height of water increases linearly with time. I have yet to prepare the proof.

Gerson.

P.S.: The above code works also on the HP 49G, but the following is slightly shorter:

Code:

%%HP: T(1)A(D)F(,);
« # 83h # 3Fh BLANK
PICT STO 66, 125,
  FOR c c 66, - ƒ 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 { # 0h # 0h }
{ # 82h # 3Fh } BOX {
# 7Dh # 0h } { # 7Dh
# 3Fh } LINE { # 6h
# 0h } { # 6h # 3Fh }
LINE 7, 65,
  FOR c c NEG 65, + ƒ
NEG 8, + 4, * RB c
RB SWAP DUP2 NEG 63,
+ 2, LIST UNROT 2,
LIST LINE
  NEXT { # 0h # 0h }
PVIEW 2, WAIT 7, 64,
  FOR c c NEG 65, + ƒ
NEG 8, + 4, * 1, +
RB c RB SWAP DUP2
NEG 63, + OVER NEG
131, + DUP2 6, PICK
2, LIST UNROT 2,
LIST LINE 2, LIST
UNROT 2, LIST TLINE
{ # 0h # 0h } PVIEW
,5 WAIT
  NEXT { # 0h # 0h }
PVIEW
  DO
  UNTIL KEY
  END DROP
»
Find all posts by this user
Quote this message in a reply
Post Reply 


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



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