Advent of Code 2024

One week away!

Advent of Code is a series of daily programming puzzles from December 1st to 25th, becoming progressively more difficult each day. The puzzles can be completed in any programming language- inputs are short text files and the solutions are integers. Many people use these puzzles to learn a new language or try new techniques.

We can reuse last year’s leaderboard code 1708445-6a8f7730. You can join on the Private Leaderboards page while logged into your AoC account.

Let’s share our solutions in Ada and SPARK! Use the forum’s spoiler tag where appropriate and make sure to have fun saving Christmas!

10 Likes

@JeremyGrosser We would like to run an Advent of Ada charity again. Should I send people to this post?

3 Likes

Sure. I’ll be creating a new topic for each day’s puzzle discussion, but if you want responses all in one place then this topic is fine.

2 Likes

It is now official that AdaCore will be donating money for every submitted solution! The blog post details how one can submit an Ada or SPARK solution to an Advent of Code problem, so please that if you intent to participate!

Happy hacking!

4 Likes

Signed up for this forum just to participate in this! I am absolute beginner at Ada, and was going to do the Advent of Code in C, but I think trying to learn Ada is a good try for something fun like the advent!

Good luck everyone!

8 Likes

@Fabien.C That’s great! :+1:

@jlin Welcome! :slight_smile: Advent of Code is indeed a good opportunity to dive into Ada. Especially since many people post links to their solutions - last year I looked a lot at how others get things done in Ada and I found it really helpful.

4 Likes
  • [max][01][Ada]https://github.com/reznikmm/advent-of-ada/blob/2024/source/day_01/day_01.adb
  • [max][02][Ada]https://github.com/reznikmm/advent-of-ada/blob/2024/source/day_02/solution.adb
  • [max][03][Ada]https://github.com/reznikmm/advent-of-ada/blob/2024/source/day_03/solution.adb
  • [max][04][Ada]https://github.com/reznikmm/advent-of-ada/blob/2024/source/day_04/solution.adb
  • [max][05][Ada]https://github.com/reznikmm/advent-of-ada/blob/2024/source/day_05/solution.adb
  • [max][06][Ada]https://github.com/reznikmm/advent-of-ada/blob/2024/source/day_06/solution.adb
  • [max][07][Ada]https://github.com/reznikmm/advent-of-ada/blob/2024/source/day_07/solution.adb
  • [max][08][Ada]https://github.com/reznikmm/advent-of-ada/blob/2024/source/day_08/solution.adb
  • [max][09][Ada]https://github.com/reznikmm/advent-of-ada/blob/2024/source/day_09/solution.adb

[Irvise][01][Ada]advent-of-code-2024/day_1/src/main.adb at 9f5443935b9e716ecf93f989dc4907afcd61bd96 · Irvise/advent-of-code-2024 · GitHub

Edit: took out the text from the post and sent it to the day 1 thread

Is this the right place to post the solutions?

[alexispaez][01][Ada]advent-of-code/2024/day_1_1/src/day_1_1.adb at 701d5f09cdbaa53a54003172e1a647b244136e61 · alexispaez/advent-of-code · GitHub

Part 2:
[alexispaez][01][Ada]advent-of-code/2024/day_1_2/src/day_1_2.adb at master · alexispaez/advent-of-code · GitHub

Hi. I’ve decided to learn Ada and see how far I get. Unfortunately, I don’t have that much time, so it’s probably not going to be steady. But, I’ve overcome the first hurdles. And I’ve solved both first day problems. Curious to see other people’s solutions, because frankly, my solution is a kind of intersection of Pascal and Java/C#.

Solution for problem 1A: [tgv][01][Ada]aoc2024/aoc202401a at master · theovosse/aoc2024 · GitHub

Solution for problem 1B: [tgv][01][Ada]aoc2024/aoc202401b at master · theovosse/aoc2024 · GitHub

3 Likes

[cunger][1][SPARK] 100hoursofada/aoc2024/src/01 at main · cunger/100hoursofada · GitHub

Complete overkill for day 1 because I’m going for SPARK this year and I’m quite a noob. :sweat_smile:

3 Likes

[Daniel-Larraz][1][SPARK]https://github.com/daniel-larraz/advent-of-code/tree/main/2024/Ada/day01

1 Like

[rocher][1][Ada] https://github.com/rocher/advent-of-code/tree/main/2024/01

I love lists, so I implemented day 1 with lists.

1 Like

Yep :slight_smile: we also have the daily thread though, but for the AdaCore donation, it should be here afaik :slight_smile:

Part 1:
[Yaroslav Rozdobudko][01][Ada] 2024/ada/day_1_historians.adb

Part 2:
[Yaroslav Rozdobudko][01][Ada] 2024/ada/day_1_historians_2.adb

1 Like

[RREE][01][Ada]AoC/2024/01 at main · RREE/AoC · GitHub

[jrcarter][01][Ada]AoA_24/aoa_01_1.adb at 30c977d077acf54428072055f99fc3d351a96dee · jrcarter/AoA_24 · GitHub
[jrcarter][02][Ada]AoA_24/aoa_02_1.adb at main · jrcarter/AoA_24 · GitHub

[Chris660][1][Ada] AOC-2024/Day_01/main.adb
[Chris660][2][Ada] AOC-2024/Day_02/main.adb

1 Like

[jcmoyer][1][Ada] puzzles/AdventOfCode2024/src/day01.adb at 8cb3bf3b056c846950b365dc4736334ad63c3836 · jcmoyer/puzzles · GitHub

Used a min heap/priority queue I wrote ahead of AoC2024 instead of sorting after the fact.