Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/moelf/aoc2023

Advent of Code 2023
https://github.com/moelf/aoc2023

advent-of-code advent-of-code-2023

Last synced: 2 months ago
JSON representation

Advent of Code 2023

Awesome Lists containing this project

README

        

[![Build Status](https://github.com/Moelf/AoC2023/workflows/CI/badge.svg)](https://github.com/Moelf/AoC2023/actions)

Advent of Code 2023: https://adventofcode.com/2023

## How to contribute
- upload input and solutions in the same PR. Name and clean up them properly
- when adding a new programming language, remember to update `runtests.jl` to "teach" it how to compile & run the ``

When testing locally, you can choose languages you want. For example, to avoid building C++ with bezel:
to run - `julia runtests.jl python cpp`
```
> julia runtests.jl python cpp
Test Summary: | Pass Total Time
Day 00 | 4 4 0.3s
python 00.py 00_test.txt | 2 2 0.0s
cpp 00.cpp 00_test.txt | 2 2 0.3s
```

## Repo structure
```bash
AoC2023/
├── runtests.jl
├── inputs
│   ├── 00_test.txt
│   ├── 01_bauerc.txt
│   └── 01_moelf.txt
├── solutions
│   ├── 00_test.txt
│   ├── 01_bauerc.txt
│   └── 01_moelf.txt
└── src
├── cpp
│   ├── 00.cpp
│   └── 01.cpp
└── julia
├── 00_test.jl
└── 01_bauerc_moelf.jl
```

- the input files should be named as `_.txt`, the content should be the input of the day without any dangling empty lines at the end
- the solutions files should be named exactly as corresponding input file, the content should be exactly one or two lines (depending on if you solved both parts)
- the `src//_.` should matched the double-digit day number convention. The `` should match what appears in [`runtests.jl`](https://github.com/Moelf/AoC2023/blob/main/runtests.jl#L18-L28)

## Note for Julia
Each `_julia.jl` script should use a `main()` and `@__FILE__` pattern similar to:
```julia
function main(path)
println("hello world")
println("solution 2")
end

(abspath(PROGRAM_FILE) == @__FILE__) && main(ARGS[1])
```

this way we can put each script int a `DayN` module and compile only once per day.