Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.55 KB

File metadata and controls

37 lines (27 loc) · 1.55 KB

Contributing

How do I add a solution for a given day?

  1. Pop some popcorn 🍿 (or whatever you enjoy 🍭 🍾 🥛 🍷 🍹 🍫 🍺)
  2. Fork
  3. Write a solution, in the language of your choice. Example: vim day-03/solutions/super-optimized.py
  4. Test your solution.
cd days/day03
../../languages/python.sh input.txt output.txt solutions/super-optimized.py
  1. Add the test to day03/test.sh, to let the CI know how to test your solution.
  2. Make a Pull Request to the main branch.
  3. One of the maintainers will merge when the tests pass!
  4. Remember to have fun 🎉

How do I add a language?

  1. Add the language you want to the Dockerfile
  2. Add a language test-script in languages/<new-language>.sh
  3. Add an example solution in days/day-00-example/solutions/example.<new-language>
  4. Make a PR to main-branch.
  5. One of the maintainers will do make docker.build and make docker.push and merge your PR on his machine ASAP 🏎️

How are solutions tested?

Every solution gets the input.txt-file delivered to stdin using cat, and whatever is written to stdout is compared for equality against output.txt using diff. This is identical for every language.

#!/usr/bin/env bash
cat input.txt | <solution-in-any-language> | diff - output.txt

See day-00-example/solutions/, for examples on how to read from stdin and how to write to stdout in different languages.