23. Two-Point Distance

The spring winds over Dorpat carried the scent of thawed soil and damp stone. Along the southern fields, men with measuring poles trudged through mud, marking the line where the new railway was to be drawn.

Mihkel stood among them, coat buttoned to the throat, his notebook held carefully against the wind. Beside him, Professor Reichenstein squinted through a brass telescope mounted upon a wooden tripod.

„They want numbers,“ the professor muttered, „but not approximations. Distances to the span of a boot, to the tilt of a nail. Geometry is no longer philosophy, it is governance.“

He glanced sidelong at Mihkel. „You speak of logic and its machinery—then show me what such reasoning can do. Two points, marked here and here,“ he tapped his field ledger, „find the distance. Not by instinct, but by proof.“

Johann, who had come only for the novelty of it, grinned as he paced the muddy span between the two poles. „So now we measure the world in thoughts instead of steps!“ he laughed. „Careful, Mihkel, or you’ll reduce all of Dorpat to a page of your notebook.“

Mihkel said nothing. He noted the two coordinates, his hand steady even as dusk thickened over the fields. When the others turned homeward, he lingered—gazing down the faint line between the poles, as if seeing not distance, but something invisible that filled the space between.

There, beneath the dormer window, the Logic Mill awaited. Its brass plates gleamed faintly in lamplight, patient, expectant. This was no mere counting now. It was the measure of separation itself— the space between two certainties.

Mihkel set the tape. The Mill stirred, clicking softly as it traced differences between coordinates, summing their squares, seeking the hidden length that joined them.

He watched the gears spin, not with the fever of invention, but with the calm of inevitability.

On the input tape, you’ll receive the 2D coordinates of two points a and b, each encoded in unary, in the following format: ax,ay;bx,by. Your task is to calculate the Euclidean distance between the points and write it to the output tape in unary format.

The distance is guaranteed to be a positive integer.

For example, if the input tape is |,||;||||,|||||| (a = (1, 2) and b = (4, 6)), the output should be |||||.

Sign in to submit your solution.