- Pop some popcorn 🍿 (or whatever you enjoy 🍭 🍾 🥛 🍷 🍹 🍫 🍺)
- Fork
- Write a solution, in the language of your choice. Example:
vim days/day-03/solutions/super-optimized.py - Test your solution
$ ./lang/python.sh "days/day-03/solutions/super-optimized.py" "days/day-03/io/my.input days/day-03/io/my.output"
# ..or use the short-hand
$ ./lang/python.sh "days/day-03/**/*.py" "days/day-03/io/*"
cat INPUT | python3 day03.klyve.py 13ms ✅
cat INPUT | python3 day03.preng.py 11ms ✅
cat INPUT | python3 one-liner.py 12ms ✅-
Make sure
days/day03/test.shtests your solution. -
To test the whole day do:
./days/day03/test.sh
# or
make test.day03
# or
make docker.day03- When you are happy with local testing, make a Pull Request to the
mainbranch. - One of the maintainers will merge PR's, at the of each day.
- Remember to have fun 🎉
- Add the language you want to the
Dockerfile - Add a language test-script in
lang/<new-language>.sh - Add an example solution in
days/day-00-example/solutions/example.<new-language> - Make a PR to
main-branch. - One of the maintainers will push a new docker-image to dockerhub.com, based on your PR.
- ...then make sure Github workflows uses the new docker-image.
- ...then merge the PR.
Every solution gets the io/*.input-files for a given day delivered to stdin, using cat. Whatever is written to stdout by the solution, is then compared for equality against io/*.output-files, using diff. This is identical for every language.
#!/usr/bin/env bash
cat day-03/io/my.input | <solution-in-any-language> | diff - day-03/io/my.outputSee day-00-example/solutions/, for examples on how to read from stdin and how to write to stdout in different languages.