Post Reply 
HHC 2019 programming contest entries
10-22-2023, 04:15 PM (This post was last modified: 10-26-2023 01:01 PM by DavidM.)
Post: #8
RE: HHC 2019 programming contest entries
(10-13-2019 09:09 PM)John Keith Wrote:  Here are machine-readable program listings for the three RPL entries.

Roger Hill's program does not run correctly and does not have the indicated size and checksum. If anyone has access to the actual program data or can figure out what the problem is, please post it here.

I realize this is an old thread, but I took a look at the hand-written notes for Roger's entry and I believe I may have translated them into a working version of his program:
Code:
\<< 1. 9. FOR m                       @ m goes from 1 to 9
  m DUPDUP * *                        @ calc m^3
  m 2. MOD                            @ lower limit of n
  m 1. + 2. ALOG * PICK3 - 3. XROOT   @ upper limit of n
  FOR n                               @ start m-loop
    n DUPDUP * *                      @ calc n^3
    DUP2 +                            @ calc m^3+n^3
    m 10. * n + 1. + 10. * n + 1. +   @ calc thing in refinement #4
      10. * SWAP - 3. XROOT
    0. SWAP                           @ limits for p
    FOR p                             @ start p-loop
      DUP2 + p DUPDUP * * +           @ calc m^3+n^3+p^3
      m 10. * n + 10. * p +           @ calc number mnp
      OVER == IF                      @ are they equal
      THEN R\->I                      @ real->integer form for better appearance
      UNROT                           @ put above other stuff
      ELSE DROP END
    NEXT DROP                         @ done with this m, n
  2. STEP DROP                        @ go to next n in steps of 2
  NEXT \>>                            @ go to next m; end of program when
                                      @   m is exhausted

The above appears to give the correct output on a 50g, but the checksum and size are still not the same as indicated in Roger's notes. Given that his stated filesize is 25 bytes smaller than the above code (265.5 vs. 290.5 for this one), I'm wondering if he used an earlier version of the program for those figures in his notes.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2019 programming contest entries - DavidM - 10-22-2023 04:15 PM



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