This year, I wanted to start AoC better prepared than other years, as I got pretty tired of tediously copying inputs by hand on Android. So I wrote a little library for structuring the code for implementing the solutions, getting (and caching) the personalised input, running and submitting solutions.
You can find it at https://github.com/jpjacobs/general_jaoc/tree/main install it as: install'github:jpjacobs/general_jaoc' A typical solution file would contain: setup_aoc_ 2022 NB. using 2022 because 2023 doesn't have published tasks yet 1 day {{ par =: 0,~ , 0&".;._2 p1 =: [: >./ +/;._2 [: par p2 =: [: (3 +/@{. \:~) +/;._2 [: par 0 }} NB. and so on for the other days 1 run 1 NB. run with headers, day numbers and totals, getting input as needed. You need to provide the authentication cookie advent of code sets in your browser in the file COOKIE.txt in the current directory (setup can also set the directory for you, using 2022 setup_aoc_). "day" takes the day number on the left, and a verb, which should implement the solutions for the day's part 1 and part 2 in p1 and p2 (which default to 0:). All definitions in the solution verb are defined in the day's private locale, d1 in this case. This is nice, because you can just reuse definitions from previous days, either all at once: coinsert 'd1' or one name: foo =: foo_d1_ "run" runs and times the verbs in its y argument (and now comes the nice part). taking care of downloading and saving, or reading from an existing file, the input for the correct day. There's also a verb "sub", that allows simply submitting the last result that "run" has yielded for a day. For instance, after running day 1, you could do: "sub 1 1" to submit the last result to AdventOfCode. It will return a portion of the raw HTML output (not pretty, but functional). It runs both on Linux and Android so far (or likely any platform using cURL as downloader). For Android, the HTTPCMD_wgethttpd_ was empty, but at least on my Samsung phone, setting it to curl appears to work. If anyone wants to add wget support, or improve on output (I just hack out the part in <article></article> tags), you're welcome to submit a PR. Hope this is useful :) Jan-Pieter ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm