Post Reply 
[VA] HP-71B Mini-challenge: Qualifying for a job
09-17-2022, 09:05 AM
Post: #19
RE: [VA] HP-71B Mini-challenge: Qualifying for a job
(09-17-2022 07:23 AM)J-F Garnier Wrote:  
(09-17-2022 06:14 AM)ThomasF Wrote:  You could eliminate 2 bytes by the following trick:
Code:
1 DEF FNZ @ DEF FNO=1
No, it's an illusion, it doesn't work as expected. Smile

Hi again,

Hm, maybe I missed something?
I tried with your example, and rearranged it a bit (moved FNZ to the beginning):

Code:
0001 DEF FNZ @ DEF FNS(C) @ IF C>0 THEN FNS=FNS(C-1)+RND
0002 END @ DEF FNG=FNS(8)-4 @ DEF FNO=1 @ DEF FND=INT(RND*6)+1

0005 DEF FNG @ DEF FNT=5
0010 DISP TIME$ @ PAUSE

That worked fine, even when inserting line 5 and 10, sinced I expected the END at beginning of line 2 would act as a "DEF END", ie. executing "FNZ" will not display the time (only 0), but FNG sure will (show the time) but not FNT (will just show 5) ...

Cheers,
Thomas

[35/45/55/65/67/97/80 21/25/29C 31E/32E/33E|C/34C/38E 41C|CV|CX 71B 10C/11C/12C/15C|CE/16C 32S|SII/42S 28C|S 48GX/49G/50G 35S 41X]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] HP-71B Mini-challenge: Qualifying for a job - ThomasF - 09-17-2022 09:05 AM



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