5 ms·
Every puzzle comes with example inputs and expected outputs. Those inputs are much smaller than the puzzle input, but if you get the example inputs and expected
by a_humean 5y ago
Every puzzle comes with example inputs and expected outputs. Those inputs are much smaller than the puzzle input, but if you get the example inputs and expected outputs right then you are probably most of the way there.
Basically every puzzle comes with unit tests that just need to be translated into code.
- someuname 5y agoThose would be functional tests
- jacobmischka 5y agoSame thing if your whole solution is a single function :)
- NoahTheDuke 5y agoWhich is another name for unit tests.
- thom 5y agoYup, although I do enjoy finding edge cases that aren’t necessarily present in the examples or input. I intend to do a fair bit more property-based testing this year, just for kicks. That’s something I’ve had success with for raw algorithmic code but struggled with in the past for nitty-gritty real-world use cases.