- Pop some popcorn 🍿 (or whatever you enjoy 🍭 🍾 🥛 🍷 🍹 🍫 🍺)
- Fork
- Write a solution, in the language of your choice. Example:
vim 2020/day03/solutions/my-solution.py - Test your solution
$ ./lang/python.sh "2020/day03/solutions/my-solution.py" "2020/day03/io/my.input 2020/day03/io/my.output"
# ..or use this short-hand
$ ./lang/python.sh "2020/day03/solutions/my-solution.py" "2020/day03/io/*"
cat INPUT | python3 my-solution.py 13ms ✅-
Make sure
2020/day03/test.shtests your solution. -
To test the whole day do:
./2020/day03/test.sh
# or test in docker container
make name=2020/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
examples/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.
Example:
#!/usr/bin/env bash
cat day03/io/my.input | <solution-in-any-language> | diff - day03/io/my.outputSee examples/solutions/, for examples on how to read from stdin and how to write to stdout in different languages.