Post Reply 
[VA] My 2024's very first little teaser
01-18-2024, 11:00 AM (This post was last modified: 01-18-2024 12:56 PM by J-F Garnier.)
Post: #4
RE: [VA] My 2024's very first little teaser
I too understand that explicit (or obfuscated) use of the 4 arithmetic operators is forbidden as well as their immediate derivates.
But high level commands that use indirectly or implicitly these operations must be allowed. Otherwise I don't see how to do anything useful.
[BTW, Peter, you used MOD which is not allowed, but you can easily use BINAND instead.]

And I too thought about the DOT command (of the Math ROM), because it does exactly what we need here: a sum of products.

Here is my simplest attempt:

10 OPTION BASE 1
20 DIM U(3),V(3),W(6),Y(2),Z(2)
30 MAT INPUT V,W
40 Y(1)=W(6) @ Y(2)=W(3) @ Z(1)=W(2) @ Z(2)=W(5) @ U(1)=DOT(Y,Z)
50 Z(1)=W(1) @ Z(2)=W(4) @ U(2)=DOT(Y,Z)
60 Y(1)=W(5) @ Y(2)=W(2) @ U(3)=DOT(Y,Z)
70 DISP DOT(U,V)

>RUN
V(1)? 1,7,2,-3,4,-1,2,3,1
-36


There is probably still room for code size optimisation (174 bytes for this deliberately non-packed version).

Edit:
Although the teaser is targetting the HP-71B only, the same program just runs fine on the 75C (with its Math ROM), but uses 321 bytes !

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] My 2024's very first little teaser - J-F Garnier - 01-18-2024 11:00 AM



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