MC: Faster User-RPL HILBERT
|
07-09-2018, 05:25 PM
Post: #5
|
|||
|
|||
RE: MC: Faster User-RPL HILBERT
(07-09-2018 03:16 PM)Thomas Okken Wrote: I'm guessing the point of the exercise is to avoid unnecessary calculations. Exactly. (07-09-2018 03:16 PM)Thomas Okken Wrote: This will do so, at the cost of putting n^2 objects on the stack: I like your idea of pre-calculating n-1 and storing it in a local variable (n1) rather than doing "n 1 -" over and over inside the loop (which is what I did). Your program is therefore faster than mine: 50×50 in 0.71 seconds instead of my 0.8 seconds on an HP 50g in approx mode. And I was surprised that your "n DUP 2 ->LIST ->ARRY" is shorter than my "{ n n } ->ARRY". Very cool! <0|ɸ|0> -Joe- |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)