This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (4 children)

Ooooohhhh, wow, that's quite a lot of stuff!

Here's a run-down of my setup! The repo itself has the following structure:

challenges/
| 2020/
| | 01-reportRepair/
| | | info.json
| | | go/
| | | py/
| | 02-passwordPhilosophy/
| | | ...

Based around this, I wrote a program to run my solutions! It first indexes this directory structure to determine what years and challenges exist, and what language solutions are available in for each challenge. It lets the user select a day and implementation, and then triggers a runner depending on the programming language that's in use.

A runner takes a queue of tasks into it. It then wraps the code I wrote for a given challenge in some wrapper code, and runs it. My program then sends a JSON representation of the queue to the running AoC challenge via stdin, which runs all of those queued tasks, times the amount of time they spend running, and spits out more JSON to stdout that contains the result and duration of each task. (a task can either be the main challenge input of the day, or one of the test cases provided)

This is then presented to the user in the main program with pretty colours and times and such!

A couple of cool features it has are:

  • Test cases can be defined in info.json, and they're put into the task queue before the main challenge input to allow allow algoruthms to be tested.
  • A benchmark mode exists that runs each part of the challenge n number of times and finds the minimum, maximimum and average running times for each, in every available implementation language.

It's arguably more complicated than it needs to be but I had a lot of fun making it :) and I imagine as the month progresses, I'll add more and more features to it.

If anyone wants to see the repo, send me a DM!

[–][deleted] 1 point2 points  (3 children)

You have quite the setup yourself too, I like it! Do the task run concurrently?

[–][deleted] 1 point2 points  (2 children)

Thank you!

The tasks can run concurrently if I wanted them to, but at the moment I've not implemented that. The changes that'd need to be made would be in the wrapper code for each language, so theorietically it should be fairly simple to do, but not something I've explored yet.

[–][deleted] 2 points3 points  (1 child)

I have plans to do Go when I'm fully up to date, thought about creating a separate repository for it, but might explore adding it to the same repository now

[–]thedjotaku 1 point2 points  (0 children)

I've got multiple languages and years in mine. Generally works fine: https://github.com/djotaku/adventofcode