Post Reply 
Advents of Code (programming challenges)
12-07-2022, 09:52 PM
Post: #5
RE: Advents of Code (programming challenges)
(12-07-2022 08:50 PM)pier4r Wrote:  DavidM will you post the code somewhen?
It would be always interesting (and a possibility for learning) but especially some days are tricky (parsing, of all things).

For example Day 7 is interesting, as AFAIK RPL doesn't have trees but neither associative arrays.

Yes, I looked at Day 7 briefly and thought that the sample was probably doable on a 50g, but I haven't tried it yet and believe that the memory requirements (and possibly runtime) using the final data they provide may be beyond what the calculator could manage. Given that the problems generally get more complex with each passing day, today may be the end of the line for what the 50g could reasonably handle.

I was able to complete days 1-6 on the 50g so far (all of them using ListExt, which has been a good fit). For the first 4 day's puzzles, I simply stored the given data in the same directory as the code as a string variable. The code then loads it and converts it to a list for processing.

Starting with day 5, I decided to go a different route with the input due to the time it was taking to load/convert it every time I would do a trial run. I basically create the list structure independent of the main program and store it as a hex string. Converting it into the needed list can then be done with H-> from library 256. It's a little more involved than that (mostly in dealing with linefeeds), but it streamlines using the given data for testing.

I'll post a couple of days puzzles if there's interest.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Advents of Code (programming challenges) - DavidM - 12-07-2022 09:52 PM

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