Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.46 KB

File metadata and controls

36 lines (28 loc) · 1.46 KB

Scanners

Those challenges are becoming more and more about the visualization. :)

Screen.Recording.2023-07-06.at.22.40.39.mov

But along the way I figured out the smart solution. I like smart solutions. So the scanner oscilates. Goes up and down, and arrives at its starting position, and then loops. How much steps does it take it to do one loop? Well, it starts at range=1, moves through all intermediate ranges, arrives at range=max, and goes back — through all the intermediate ranges again:

1 . 
2 | |
3 | |
4 | |
5 | |
6   '

So given range 6 for example, each cycle it visits 4 middle items twice, then each edge once, which gives 2 × 5 steps. Each scanner uses (range - 1) × 2 steps for each cycle.

Now, since we only really care about when they arrive at positions 0, through which we travel, we need to know which cycles complete (i.e. the scanner moves back to first position) at the time we arrive at a given depth. And this translates to: which scanners term divide their depth without remainder.

Some learnings from today