Post Reply 
Surprise graphic program (HP-48G, GX)
10-29-2014, 06:00 PM
Post: #15
RE: Surprise graphic program (HP-48G, GX)
(10-29-2014 01:38 PM)Gilles Wrote:  Small improvment with the sand flowing ...
For 49G+/50G

Code:
 
\<<
 #131d #80d BLANK PICT STO 
 (-66 -10) (65 9) PDIM

 0. 60. FOR x
  x DUP \v/ R\->C DUPDUP PIXON CONJ PIXON
  NEG DUP CONJ 
  IF DUP RE -46 > THEN LINE ELSE PIXON PIXON END 
  IF x 2 MOD THEN x 0 R\->C (0 .1) - DUP CONJ BOX END
 NEXT
  
 (-64 -8) (64 8)  BOX 
 (-61 -8) (-61 8) LINE
 ( 61 -8) ( 61 8) LINE
 
 { # 0d # 0d } PVIEW
 
 45. 2. FOR x
  (1 0) DUP x 14 + + TLINE
  x 15 + DUP \v/ R\->C DUP CONJ LINE
  x DUP \v/ R\->C NEG DUP CONJ DUP2 TLINE PIXON PIXON
  0.2 WAIT
 -1 STEP
 
 (0 0) (15 0) DUP2 LINE TLINE
 (0 -.1) (15 -.1) DUP2 LINE TLINE

 0 WAIT DROP
\>>

Very nice!

A slight modification to allow for user-selected timing:

Code:

%%HP: T(3)A(D)F(.);
\<< HMS\-> 60. * 9.4 - 44. / \-> t
  \<< # 83h # 50h BLANK PICT STO (-66.,-10.) (65.,9.) PDIM 0. 60.
    FOR x x DUP \v/ R\->C DUPDUP PIXON CONJ PIXON NEG DUP CONJ
      IF DUP RE -46. >
      THEN LINE
      ELSE PIXON PIXON
      END
      IF x 2. MOD
      THEN x 0. R\->C (0.,.1) - DUP CONJ BOX
      END
    NEXT (-64.,-8.) (64.,8.) BOX (-61.,-8.) (-61.,8.) LINE (61.,-8.) (61.,8.) LINE { # 0h # 0h } PVIEW 45. 2. 0. WAIT DROP
    FOR x (1.,0.) DUP x 14. + + TLINE x 15. + DUP \v/ R\->C DUP CONJ LINE x DUP \v/ R\->C NEG DUP CONJ DUP2 TLINE PIXON PIXON t WAIT -1.
    STEP (0.,0.) (15.,0.) DUP2 LINE TLINE (0.,-.1) (15.,-.1) DUP2 LINE TLINE 0. WAIT DROP
  \>>
\>>

Usage:

- Enter time in mm.ss format; time >= 0.093 (9.3 s).
- run program
- any key to start
- any key to exit

Now it can be used for controlling the time to boil an egg, for instance :-)

When the hourglass is half way past the selected time it appear to get "choked with sand". This happens in your previous version also. This becomes irrelevant as times get longer, however.

Gerson.
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-29-2014 06:00 PM



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