Skip to main content

Module probe

Module probe 

Source
Expand description

Probing a sequence of trial values until one decides: a step halved until a point stepped off a curve lands where it should, a reach doubled until it brackets a crossing, a point marched on until it passes one, a ray cast in one direction after another until one is clear of every vertex.

What is probed is a free choice — how far to step, how far to reach — and what the probe finds there is the caller’s to judge. The solver promises only the sequence: start, then each value next makes of the one before, at most most of them, each asked once and in order. It answers None when none decided, never the last value tried.

Enums§

Probe
What a probe found at one value of the sequence.

Functions§

attempts
probe over attempts 0, 1, 2, … — at most most of them — for a sequence at makes itself (the k-th of a set of directions, the next draw of a seeded generator).
halve
probe with a step halved each time: start, start / 2, … — at most most of them.
probe
Asks at for start and each value next makes of the one before, at most most of them, until one is Probe::Found or Probe::Stop. next is asked only for a value that will be probed. at may keep state of its own (what the probes so far said), since every value is asked once, in order.