Post Reply 
HHC 2019 programming contest entries
10-13-2019, 09:09 PM
Post: #7
RE: HHC 2019 programming contest entries
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.

Joey Shepard's program returns the correct numbers but crashes at the end due to an index error for GET. The problem seems to be that the list in the program has only 8 elements. I added an extra 9 to the list in the version posted here which makes the program run correctly.

Bill Butler's program runs without errors and returns the correct numbers. I'll be damned if I can figure out how it works but it does. Smile

Bill Butler:

Code:

\<< 0. 9.
  FOR j j DUP 3. ^ NEG DUP2 + { 0. 1. 8. 7. 4. 5. 6. 3. 2. 9. } SWAP OVER - 10. MOD DUP 3. ^ SWAP 10. * PICK3 ADD 10. * 5. ROLL ADD 4. ROLL OVER ADD ROT 4. ROLL 3. ^ ADD OVER - XOR SWAP IFT
  NEXT + + + EVAL
\>>

Roger Hill:

Code:

\<< 1. 9.
  FOR m m DUPDUP * * m 2. MOD m 1. + 2. ALOG * PICK3 - 3. XROOT
    FOR n n DUPDUP * * DUP 2. + m 10. * n + 1. + 10. * n + 1. + 10. * SWAP - 3. XROOT 0. SWAP
      FOR p DUP 2. + p DUPDUP * * + m 10. * n + p + OVER ==
        IF
        THEN R\->I UNROT
        ELSE DROP
        END
      NEXT DROP 2.
    STEP DROP
  NEXT
\>>

Joey Shepard:

Code:

\<< 1. 9.
  FOR I I I I * * 'A' STO I 100. * 'C' STO 0. { 6. 7. 8. 8. 9. 9. 9. 9. 9. } I GET
    FOR J J J J * * 'B' STO J 10. * 'D' STO 0. 9.
      FOR K A B K K K * * + + C D K + + DUP ROT
        IF \=/
        THEN DROP
        END
      NEXT
    NEXT
  NEXT { A B C D } PURGE
\>>
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2019 programming contest entries - John Keith - 10-13-2019 09:09 PM



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