workshop private

← all sprites

Double Step

sprites · created 2026-10-10

180×80 pixel Enigma stepping gear with three loops — three ratchets, three notched rings, three pawls on one bar. A pawl sitting in a notch is not a follower, it is a driver, and because one pawl does two jobs the middle rotor sometimes moves twice in a row. The odometer that should run 17,576 keys runs 16,900, and 650 of its positions can never occur.

algorithmssimulationpixel-artcanvas

Three wheels and an odometer. The right one turns every key, the middle one turns when the right one has gone all the way round, the left one when the middle one has. Anybody who has read a car’s mileage knows the shape of it.

Except that it is not quite that, and the part that is not is not a quirk of the wiring or the code — it is a consequence of there being three pawls and only three, each asked to do a job and a half.

The pawls, and what holds them off

Each rotor carries two rings of teeth. On one face, a ratchet: 26 sawteeth, one per letter, which is what a pawl pushes on. On the other, the alphabet ring, a smooth circumference with a single notch cut in it.

A pawl lies in the groove between two rotors. Its tooth is over the ratchet of the rotor on its left; its tip rests on the alphabet ring of the rotor on its right. A spring presses the whole thing inward, and full ring diameter holds it out — tooth clear of the ratchet, the key stroke wasted. Only when the notch comes round under the tip can the pawl fall far enough in for its tooth to reach.

The rightmost pawl has nothing to its right but the fixed entry wheel, which carries no ring at all. Nothing ever holds it out, so it is in the ratchet on every single key. That is why the fast rotor is the fast rotor: not a gear ratio, an absence.

A pawl in a notch is pushing on the notch

Here is the whole piece, and it is one sentence.

The pawl that has fallen into a notch is not resting in it. The bar is about to shove that pawl sideways by one tooth — and the pawl is inside the notch, with the notch’s trailing flank against it. So it pushes two things at once: the ratchet of the rotor on its left, through its tooth, and the alphabet ring of the rotor on its right, through its own body.

Every pawl drives two rotors. One deliberately, one as a side effect nobody asked for.

For the middle pawl this costs nothing: the rotor it drags is the right-hand rotor, which was stepping anyway. For the left pawl it is a second mover on a rotor that already has one. The middle rotor can be advanced by its own pawl, when the right rotor is at its notch; or dragged by the left pawl, when the middle rotor is itself at its notch. And those two happen on consecutive keys.

The walk everyone is shown

Rotors I, II, III, left to right, at ADU:

keywindowleftmiddlerightwhat happened
0ADU··ratchet—
1ADV·ratchetratchetturnover
2AEWratchetdraggedratchetdouble step
3BFX··ratchet—
4BFY··ratchet—
5BFZ··ratchet—
6BFA··ratchet—
7BFB··ratchet—
8BFC··ratchet—

D to E to F, on two keys running, with only one full revolution of the right rotor between them. The sprite draws the difference in colour: an orange ratchet is being pushed by a tooth, a green ring is being shoved by a pawl’s flank. At AEW the middle rotor is green.

The notch is on the ring, not on the wiring

Worth saying because it is the one part of the machine that moves relative to the other: the notch is cut in the alphabet ring, and the Ringstellung turns that ring against the wiring core. So setting the ring moves the wiring out from under the notch, and never the notch out from under the window.

Which is why turnovers are quoted as window letters and are always the same ones, and why the mnemonic works at all:

rotornotch (window letter)steps into
IQR
IIEF
IIIVW
IVJK
VZA
VIZ, MA, N
VIIZ, MA, N
VIIIZ, MA, N

Royal Flags Wave Kings Above — the letters I–V step into.

What it costs the odometer

Three wheels of 26 is 17,576 positions, and a plain odometer would visit all of them before repeating. This one does not, and the gap is not small change.

quantityvalueas
positions a three-rotor odometer has17,57626³
positions the stepping visits16,90026 × 25 × 26
positions it never returns to67626²
…of those, with no predecessor at all65026 × 25
right rotor moves16,900650 revolutions
middle rotor moves67626 revolutions
left rotor moves261 revolution
double steps26one key in 650
a 250-letter signal250 keys1.48% of the period

The 25 in the middle is the double step, counted: the middle rotor passes through 26 letters but is only held at 25 of them for a full revolution of the rotor below it. At its own notch letter it is pushed straight out again on the following key, and that one letter of the 26 is the entire difference between 17,576 and 16,900.

Six hundred and fifty positions that cannot happen

The missing positions are not scattered. Ask which positions have no predecessor — which readings the machine can never show one key after showing anything at all — and the answer is a single row:

whatvalue
count650
middle rotor letters involvedE
right rotor letters not involvedW
left rotor letters involvedall 26

E is rotor II’s notch letter. W is where rotor III lands after its turnover. The middle rotor can only arrive at its own notch by being pushed there by the rotor below, and the rotor below only pushes when it is stepping into W. So E in the middle window with anything but W on the right is a reading the machine cannot step into — only one you can set by hand, and then it leaves on the next key and never comes back.

That is the red row in the demo’s grid: 26 columns, 25 of them dead.

The navy made it worse

Rotors VI, VII and VIII carry two notches each, at Z and at M. More turnovers per revolution sounds like more movement, and it is — the middle rotor is driven twice as often. It is also, for the odometer, straightforwardly destructive:

rotor orderperiodcyclesno predecessorleft movesmiddle movesdouble steps
I-II-III16,90016502667626
III-II-I16,90016502667626
II-V-IV16,90016502667626
I-V-III16,90016502667626
I-II-VI8,45026242667626
I-VI-III8,11221,3002633826
VI-VII-VIII4,05641,2482633826

Any three of I–V, in any order, give 16,900 — the period does not care which rotors or which order, only that each has one notch. Put a two-notch rotor on the right and the period halves. Put one in the middle and it halves again and the reachable positions fall into two cycles that never meet. All three navy rotors: 4,056 keys, four separate cycles, a quarter of what the army machine managed.

The left rotor turns exactly once per period in every one of these, which is the clearest way to say what the period is: it is however long the slow rotor takes to come home, and everything else is a question of how fast the middle one feeds it.

None of this is a break. 250 letters is a long signal and 1.48% of one army period; no operator ever wrapped round. It is the more ordinary kind of defect — a machine whose designers could tell you its key space to the digit, and whose stepping gear quietly disagreed with them by four per cent, for reasons that are entirely visible if you take the lid off.

Reuse

source/double-step.mjs is framework-free, with no canvas in it. The stepping is 20 lines; the rest is the drawing and the counting.

The demo is demo/index.html with its own copy of the module (ADR-0002). It sizes itself to its viewport, so the site’s full-screen button just works. Space bar is a key press.

What is derived here, and what isn’t