Some Ada source-code proposals for the puzzles of the © Advent of Code, year 2022 contest prepared by Eric Wastl 😎
MON | TUE | WED | THU | FRI | SAT | SUN |
---|---|---|---|---|---|---|
- | - | - | 01 | 02 | 03 | 04 |
05 | 06 | 07 | 08 | 09 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
Note: There are still other GitHub repositories (20+) with Ada code proposals.
Aiming as a show-case of some best(?) Ada 2012/2022 coding practices.
- Readability
- Modular & Object Oriented software design
- Only using the libraries defined by the language, and shipped with any Ada compiler
- Use multi-tasking design when appropriate
- Execution time (performance) is not a first class goal (back to 1. & 2.)
Other seasoned or just plain beginner developer have published their Ada code on github (or elsewhere...)
I used the forthcoming Ada 2022 syntax and language-libraries, essentially:
@
as a shorthand syntax, as inSum := @ + 1;
- Pretty Printer: GNAT pretty-printer
- Compiler: GNAT from GCC 12.2.0
- Build: GNAT gprbuild
- Package-Library manager: Alire
These Ada source code have been written and built on macOS, and also rebuilt and deployed on FreeBSD (as in CI/CD).
Alire (alr
) needs to be initialized through a first alr build
command. This completes ~/.config/alire/config.toml
file.
To select the working Ada 2022 (WIP) compiler:
alr toolchain --select
One may use plain gprbuild
instead of alr build
.
Typically:
git clone https://github.com/AdaForge/Advent_of_Code_2022.git
cd Advent_of_Code_2022/puzzle_08
alr build
bin/puzzle_08 data/input.txt
Take a look at AdaForge.org
Just plain open-source: CC0 Universal Public Domain dedication's Free Cultural Work