HHC 2021 Programming Contests - Surprise !
|
10-12-2021, 08:09 AM
(This post was last modified: 10-13-2021 07:40 AM by C.Ret.)
Post: #29
|
|||
|
|||
RE: HHC 2021 Programming Contests - Surprise !
(10-07-2021 10:50 PM)Craig Bladow Wrote: I keyed in David Hayden's excellent first place solution, which is a very elegant and compact program and ran Gene's 15151 test number as input. With 15151 as test value, my 57 bytes code takes 0'11"73 to display 15251 on an original HP-41C just because I add a PSE instruction to see progress and a BEEP instruction at end to facilitate time measurement with my watch. I am really surprise that my modest and ageless HP-41C vintage run faster that today hi-tech SwissMicro instruments ! Code: 01►LBL "PAL 1 STO 03 Removing these the instructions PSE and BEEP spare exactly two bytes in code and a bit more than two seconds of running time. (10-06-2021 05:24 PM)Dave Britten Wrote: Just for fun, I did a 71B BASIC implementation of the RPN problem. This should work on a stock 71B with no additional LEX files or modules. Just for fun, I did a BASIC implementation of the RPL problem on a stock HP-71B, not using additional LEX files or JPC ROM module. Code: CAT GOLOMB S BASIC 108 10/04/21 18:54 (108 Bytes) 1 5 -> 27 0'00"33 2 4 -> 17 0'00"26 5 5 -> 9 0'00"33 100 101 -> 882 0'06"44 1000 1500 -> 4884182 1'38"03 2000 2300 -> 5724280 2'30"39 Incidentally, because of natural contradictive mental behavior, I also made a code for the RPL problem on a HP-41C RPN: Code: 01►LBL "GO x=y? FS 02 // Flag 2 is a=b indicator Registers: R00: sum of squares R01 to R###: G(1) to G(###) where SIZE ### is the memory limit depending of your HP-41 configuration. Usage: a [ENTER^] b [XEQ][ALPHA]GO[ALPHA] display \( \sum_{k=a}^{b}G^2_k \) Speed: 1 5 -> 27 0'00"33 1 5 -> 27 0'04"85 2 4 -> 17 0'03"95 5 5 -> 9 0'04"28 100 101 -> 882 1'02"29 1000 1500 -> too few registers 2000 2300 -> too few registers (my HP-41C armed with only two memory modules is limited to SIZE 130 And again, thanks for sharing this contest problems, I learn of few fact by reading all contributions here. I surely have to initiate myself into synthetic programming13 ! EDITED Wed 13-oct 2021: corrected instruction number in last HP-41 code and add bytes count. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 9 Guest(s)