Post Reply 
[VA] HP-71B Mini-challenge: Qualifying for a job II: Your best image
10-04-2022, 08:42 PM
Post: #7
RE: [VA] HP-71B Mini-challenge: Qualifying for a job II: Your best image
.
Hi, all,

Thanks to J-F Garnier and C.Ret for their interest in this mini-challenge, time for a wrap up. J-F's solution is:

J-F Garnier Wrote:As a single DISP is allowed, a way to execute a FIX command before each argument is needed, and a user-defined-function will do it [...]

2 DISP FNF(3)+X,FNF(1)+SIN(X),FNF(4)+COS(X),FNF(1)+TAN(X),FNF(6)+LN(X)+EXP(X) @ DEF FNF(N) @ FIX N @ END DEF

which, as foreshadowed, it's virtually identical to my original solution, which is:

2 DISP FNF(3)+X;FNF(1)+SIN(X);FNF(4)+COS(X);FNF(1)+TAN(X);FNF(6)+LN(X)+EXP(x) @ DEF FNF(N) @ FIX N @ END DEF

the only difference being that J-F uses "," to separate the items while my OP uses ";", which results in a more compact output. Both solutions are 99 bytes long.

C.Ret Wrote:Simply filling in the dotted lines is not enough. But with a good shoehorn or a little trick consisting of a few additions and an omission... it's fine!!

Let's see C.Ret's solution to ascertain whether it's also identical to the ones above, which seems likely. The omission he mentions is probably the implicit DISP while entering the line.

The idea for this mini-challenge was to let HP-71B users to further realize that
  • (1) DEF FN can appear anywhere within a line, not just at the beginning.
  • (2) There's no need to assign FN any value, in which case the default is zero.
  • (3) A multi-statement user-defined function can be used to execute whatever statements (say: changing modes, logging values, etc.) in the middle of the evaluation of a mathematical expression which includes one or more calls to it at appropriate places.
All three can be put to very good use in many specialized situations and they're worth keeping in mind in case the need to use them arises.

Thanks and regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
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 II: Your best image - Valentin Albillo - 10-04-2022 08:42 PM



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