Post Reply 
[VA] HP-71B Mini-challenge: Qualifying for a job
09-17-2022, 01:57 PM (This post was last modified: 09-17-2022 02:11 PM by J-F Garnier.)
Post: #25
RE: [VA] HP-71B Mini-challenge: Qualifying for a job
.
Today I learnt something from this challenge:

Humility, never be too much sure of one's own knowledge

... because my solution is WRONG !

As in Diego's signature, "Do not suppose, check it twice."

It is true that END can be used to exit a multiline DEF structure.
But the DEF structure MUST be ended by END DEF !

For instance:
DEF FNF(X)
...
IF some condition THEN END ! exit FNF
...
END DEF

is correct.

So my new solution is, in exactly 92 bytes:

10 DEF FNS(N) @ IF N>0 THEN FNS=FNS(N-1)+RND
20 END DEF @ DEF FNG=FNS(8)+INX @ DEF FND=IP(1+RND*6) @ DEF FNZ=0 @ DEF FNO=1


J-F
Visit this user's website 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 - J-F Garnier - 09-17-2022 01:57 PM



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