Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/woutervdbrink/adventofcode
My PHP solutions for Advent of Code.
https://github.com/woutervdbrink/adventofcode
advent-of-code advent-of-code-2015 advent-of-code-2020 php php8 phpunit puzzle
Last synced: 3 days ago
JSON representation
My PHP solutions for Advent of Code.
- Host: GitHub
- URL: https://github.com/woutervdbrink/adventofcode
- Owner: WoutervdBrink
- License: mit
- Created: 2020-12-01T18:46:46.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-12-09T21:15:20.000Z (about 1 month ago)
- Last Synced: 2024-12-09T21:26:50.584Z (about 1 month ago)
- Topics: advent-of-code, advent-of-code-2015, advent-of-code-2020, php, php8, phpunit, puzzle
- Language: PHP
- Homepage: https://adventofcode.com/
- Size: 859 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Advent of Code](https://adventofcode.com/) solutions
This repository contains PHP solutions to Advent of Code.To run my solution for a particular day (and part), run `php run.php YEAR DAY [PART]`.
## PHPUnit
(Regression) testing is done using PHPUnit and a lot of unnecessary magic. All `DayNNTest` classes extend `PuzzleSolverTestCase`, which figures out what day to test using reflection. Then, a data provider is used to figure out what examples to test, and what their expected outcomes are. Finally, when I finish solving a puzzle, I implement the `getSolutionForPartN` methods. When they do not return null, the actual puzzle input is tested.This enables me to refactor code shared between tests, for example when a puzzle extends a previous puzzle or uses the same concepts, with some confidence that I'm not breaking existing rules or logic.
## License
MIT. See [LICENSE](LICENSE).