lud

lud

Hello,

I just extracted the boilerplate management code that I used to work with in previous years:

It is yet another generic input downloader (with cache), solution module generator, test generator, and commands to work with any year/day combination, promoting TDD practices.

If you have your own boilerplate or helper code, post it below, people may be interested.

Happy coding!

Showing Posts 1 to 10

lud

lud OP

If found this one too that looks pretty nice:

https://github.com/mhanberg/advent-of-code-elixir-starter

stevensonmt

stevensonmt

I decided to roll my own AoC framework/helper this year but started a day too late. I’m still trying to polish it up but pleased with it so far. I’ll try to remember to post it here once it’s done. I’m curious about how people feel about configuration for this sort of tool. I’m setting it up for myself so it’s getting the session cookie from a hard coded ENV variable and the default paths are non-configurable (though passing non-default paths is available at runtime). Is this how most people do it or would it be better to have config options setup for everything?

lud

lud OP

Well a variable or two for path prefixes with sane defaults are not hard to setup.

But few people will use our tools, maybe nobody will ; there is no need for fully configurable stuff here, it’s not like a genral purpose application framework.

I do some of the days in Rust and I use a boilerplate, I don’t really care where the files are, I just do what the README tells me because I just want to solve the problems. The “app” does not need to be deployed somewhere, it just needs to compile and be called from the console.

lud

lud OP

Hello everyone,

I’ve added more helpers and documentation for my Advent Of Code library.

It’s still just a bunch of helpers to ease fetching and caching inputs, and generate boilerplate code and tests.

But I also updated the README file to be a comprehensive guide on how to use it and solve your first AoC puzzle. This is intended for Elixir beginners and/or AoC beginners.

For more seasoned alchemist elves, I still think the library adds value (I made it for myself after all). There is a TL;DR section in the README and a documentation for all the available commands.

Tell me if you find that useful, and if you have any idea to improve it!

adamu

adamu

Personally I go with a script I just copy/paste each time. Works with no dependencies and hopefully will continue to do so for many years!

https://git.adamu.jp/adam/AdventOfCode/src/branch/main/dayN.exs

ken-kost

ken-kost

Trying out your library for this year. :santa: So far enjoy it. :raised_hands:

lud

lud OP

Nice! Thank you. Good luck for the challenges :smiley:

ken-kost

ken-kost

One suggestion: trim: true in Input.stream/2 should be default. wdyt?
edit: Also question, how to have multiple days in .aoc.defaults? I made a PR for each day and now I’m merging day 2 but the files conflict, how do I resolve this? Maybe I should just git ignore it. :thinking:

lud

lud OP

I am not sure trimming would be the default. The Input module should be as close as possible to File.stream! because without this library you can just call File.stream! on your input path and it should work as normal. There is a lot of puzzles where blank lines and indentation are meaningful, so discarding them by default does not seem a good idea to me.

Yeah you should just ignore that file. But I wonder why you use it anyway. I am not sure if the docs are clear enough but the aoc.set command is intended for working on another year, or extending your work on some day when you are not finished in time.

If you just remove the defaults file, the commands will pull the input for the current day, and generate the code for the current day as well.

Where Next? Top

Trending in Discussions Top

wmnnd
Hey folks, I wanted to share with you a project I’ve been working on for a while: It’s an Open Source (AGPLv3) newsletter tool. Think Ma...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
jam
This was an interesting post by Jose. Curious to hear what others think. Evolving programming languages in the AI era - Dashbit Blog Gen...
New
sntran
In my third year of college, around 2010, I found Erlang. A few years later, I found Elixir. I liked the ideas at once: many small proces...
New

Other Trending Topics Top

georgeguimaraes
Hi all, I want to show you Transmuter, a library that runs Hugging Face ONNX models on any Nx backend. GitHub: GitHub - georgeguimarae...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews