Age | Commit message (Collapse) | Author | |
---|---|---|---|
2022-12-13 | Input for puzzle 13 | Adam Spragg | |
2022-12-12 | Solve puzzle 12 part 2 | Adam Spragg | |
2022-12-12 | Reverse direction of search | Adam Spragg | |
2022-12-12 | Don't infinite loop if we never reach the end point | Adam Spragg | |
2022-12-12 | Solve puzzle 12 part 1 | Adam Spragg | |
2022-12-12 | Input for puzzle 12 | Adam Spragg | |
2022-12-11 | Solve puzzle 11 part 2 | Adam Spragg | |
The trick is that we don't care about how much worry there is, we only care how much worry modulo the test divisor, to figure out which monkey gets the item next. Now, I know that addition is stable under modulo arithmetic, but I seem to remember that multiplication is stable under modulo arithmetic also? (I think public key cryptography relies on this?) So, by only keeping track of our worry, modulo the product of all the test divisors, everything should still work correctly? At least, that's what I tried, and it stopped all the overflow, and I seemed to get the right numbers according to the expected test results, and my final answer was also accepted. So I guess it does work correctly! | |||
2022-12-11 | Count the number of inspections as a long | Adam Spragg | |
2022-12-11 | First attempt at puzzle 11 part 2 (buggy) | Adam Spragg | |
Turned item worry levels to unsigned long in an attempt to not overflow. Added checks for overflow, and they get hit - quickly - without the calming factor. Will need to think about this. (or try bignums) | |||
2022-12-11 | Solve puzzle 11 part 1 | Adam Spragg | |
2022-12-11 | Input for puzzle 11 | Adam Spragg | |
2022-12-10 | Solve puzzle 10 part 2 | Adam Spragg | |
2022-12-10 | Solve puzzle 10 part 1 | Adam Spragg | |
2022-12-10 | Input for puzzle 10 | Adam Spragg | |
2022-12-09 | Solve puzzle 9 part 2 | Adam Spragg | |
Needed to switch to moving the head one step at a time and recalcating the rest of the rope on each iteration, or the numbers came out wrong. | |||
2022-12-09 | Cleanup puzzle 9 part 1 | Adam Spragg | |
Now that we fixed the bug, get rid of debug output. | |||
2022-12-09 | Solve puzzle 9 part 1 | Adam Spragg | |
I wasn't creating a new tail element after inserting the first tail, so when we revisited the origin the second time it didn't spot it as a dupe, giving an off-by-one error (The test input didn't have the tail pass the origin twice, so this wasn't an issue there) | |||
2022-12-09 | First attempt at puzzle 9 part 1 (buggy) | Adam Spragg | |
Apparently the answer it gets for the full input (5736) is wrong. The answer for the test input (13) is right though. Added a bunch of debugging logic, to try and see *where* it's going wrong, but I can't see it so far. This one is interesting. | |||
2022-12-09 | Ignore .test files | Adam Spragg | |
Allows me to save the test input as a .test file without getting nagged by git. | |||
2022-12-09 | Input for puzzle 9 | Adam Spragg | |
2022-12-08 | Solve puzzle 8 part 2 | Adam Spragg | |
2022-12-08 | Solve puzzle 8 part 1 | Adam Spragg | |
2022-12-08 | Input for puzzle 8 | Adam Spragg | |
2022-12-07 | Solve puzzle 7 part 2 | Adam Spragg | |
2022-12-07 | Solve puzzle 7 part 1 | Adam Spragg | |
2022-12-07 | Remove trailing empty line | Adam Spragg | |
2022-12-07 | Input for puzzle 7 | Adam Spragg | |
2022-12-06 | Solve puzzle 6 part 2 | Adam Spragg | |
2022-12-06 | Solve puzzle 6 part 1 | Adam Spragg | |
2022-12-06 | Input for puzzle 6 | Adam Spragg | |
2022-12-06 | Create the bin/ directory if it doesn't exist | Adam Spragg | |
2022-12-05 | Only compile in code if it's used, and free memory when done | Adam Spragg | |
2022-12-05 | Add support for CrateMover9001, to solve part 2 | Adam Spragg | |
2022-12-05 | Complete puzzle 5a | Adam Spragg | |
2022-12-05 | Input for day 5 | Adam Spragg | |
2022-12-04 | Advent of code 2022 problems 1-4 | Adam Spragg | |