25. French number spelling

Early summer arrived in Dorpat with lilac blossoms and a faint scent of ink. Through the open windows of the lecture hall drifted the murmurs of scholars and the rustle of foreign papers. Upon the oak table lay a parcel bound with red string, its labels still damp from the journey north.

Monsieur Delaroche, returned from Paris, stood before the small assembly with his usual flourish. „Messieurs,“ he proclaimed, „observe how the French count—gracefully, historically, defiantly!“

He spread the sheets before them: deux cent soixante-deux, quatre-vingt-dix-sept, mille trois cent quarante et un— tables of numbers, but written wholly in words. The printers, puzzled, had refused to set them in type.

„A system without system,“ said Reichenstein dryly. „Counting by twenties—it is arithmetic by accident.“

„By memory, Herr Professor,“ Delaroche replied. „Our numerals remember Gaul itself. You may call it irregular; I call it heritage.“

The room stirred with laughter. Johann muttered something about poetry disguised as bookkeeping. Mihkel remained silent, studying the phrases. Beneath their apparent confusion, he sensed a pattern—hidden arithmetic dressed in grammar.

That night, in his attic room above the printing house, he copied the French numbers one by one. The candle burned low; the window was open to the murmurs of the town. soixante et onze, he whispered. Sixty and eleven. Strange, yet rule-bound. Each word a symbol, each symbol a clue.

He reached for the small mechanical contraption beneath a cloth—the Mill—and began to outline a set of rules. Words for units, for tens, for hundreds. Add here, multiply there. The pattern unfolded slowly, precisely, like a foreign grammar yielding to patient logic.

When the gears began to turn, the candle had nearly guttered out. From within the brass housing came the soft clicking of comprehension.

On the input tape, you’ll get a number written out in French words. Your task is to convert it into its numeric (decimal) form.

Words are separated by hyphens (-). The number will always be between 1 and 1100.

For example, if the input tape is vingt-et-un the output should be 21.

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