News for hackers. Stuff that matters.
Re:Simulating the Ladybug Clock Puzzle by ludwik on Monday January 19, 2026 @01:59AM (#46675774)
Shouldn't the code say:

    position = (position + direction + 1) % 12;
Or have I misunderstood something?
Re:Simulating the Ladybug Clock Puzzle by nulptr on Monday January 19, 2026 @02:56AM (#46676074)
The +12 there is so that % works correctly (ie the number never becomes negative)
Re:Simulating the Ladybug Clock Puzzle by LiamPowell on Monday January 19, 2026 @02:05AM (#46675805)
The +12 is to keep the number positive. The direction contains the movement so a +1 wouldn't make sense.