16. Roman to Unary

Snow pressed heavily against the mullioned windows of the university hall, muting the outside world in white silence. Inside, lamplight flickered across the faces of students and scholars gathered for a rare evening lecture. At the lectern stood Herr Vogel, a visiting antiquarian from Königsberg, his voice dry as the parchment he carried.

He unrolled a brittle scroll and pointed with a gloved hand. „Here you see the ancient reckoning of Rome—figures carved in stone, inscribed in ledgers, spoken in the Senate.“ On the page, the symbols seemed austere, proud: XLII, CCXCV, MMMDCCCLXXXVIII.

Murmurs filled the hall. A few students squinted at the numerals, baffled. Johann, ever delighted by what others found obscure, leaned toward Mihkel. „You see? These are no mere numbers. They are empires distilled—legions counted, victories sung!“

Reichenstein, seated stiffly at the back, scoffed audibly. „Obsolete clutter. Fit for tombstones and priests, not for science. A true system admits of method, not exception piled upon exception.“

Liina, who had come not for numbers but for words, tilted her head. „And yet—they survive. In churches, in calendars, even in our folk almanacs. If memory keeps them, are they not worth preserving?“

Mihkel said nothing. He traced the numerals in his notebook, watching their rigid shapes dissolve in his mind into meaning. Not empire, not ritual—just values. 42, 295, 3888. Beneath the weight of history was something simple: quantity.

That night, in his workshop, he unrolled a fresh strip of tape and marked it: IX.

The Mill had never seen such letters before. To it, they were only symbols, waiting to be walked, rules waiting to be applied. Mihkel leaned close as the gears stirred, listening to the faint clicks as if the machine itself were deciphering the past. Could the Mill translate Rome into marks of the present—unary, pure, unambiguous?

The wheels turned, the head swept back and forth, and slowly, the ancient numeral began to unravel, yielding itself to lines simple as tally marks on a shepherd’s stick.

On the input tape, you’ll get a Roman numeral (1-3999). Your task is to convert it to a unary number.

For example, if the input tape is IX, your output tape should be |||||||||.

Sign in to submit your solution.

Quest leaderboard
Discuss it on Reddit or Discord
This was the last quest for now.
Get updates about new quests by subscribing to the social media channels