diff options
author | Adam Spragg <adam@spra.gg> | 2022-12-09 16:56:52 +0000 |
---|---|---|
committer | Adam Spragg <adam@spra.gg> | 2022-12-09 16:56:52 +0000 |
commit | 4291faa39d4aad4a9cfed55600d32403422a2d4b (patch) | |
tree | d111ddd6fdb640dedb4c0de8fea2135c9271dbf3 /9.c | |
parent | 0939249b408dce6ceab9c4637c2815b3b6f5f353 (diff) |
Solve puzzle 9 part 1
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)
Diffstat (limited to '9.c')
-rw-r--r-- | 9.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -50,6 +50,7 @@ main() int ntails = 0; tsearch(tail, &tails, point_tcmp); + tail = point_copy(tail); ++ntails; fprintf(stderr, "Tail visiting %d,%d\n", tail->x, tail->y); |