From c25f9dc057497775809ecf13fcf76c044a6c670a Mon Sep 17 00:00:00 2001 From: Dash Date: Sat, 17 Oct 2026 11:08:43 +0200 Subject: [PATCH] lingo: extend roman numerals past 4000 --- pqcli/lingo.py | 5 +++++ tests/test_lingo.py | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/pqcli/lingo.py b/pqcli/lingo.py index 43461d3..717bd6d 100644 --- a/pqcli/lingo.py +++ b/pqcli/lingo.py @@ -55,6 +55,11 @@ def to_roman(num: int) -> str: ret = "-" num = -num + while _rome(10000, "T"): + pass + _rome(9000, "MT") + _rome(5000, "A") + _rome(4000, "MA") while _rome(1000, "M"): pass _rome(900, "CM") diff --git a/tests/test_lingo.py b/tests/test_lingo.py index 4d96f27..584d6e5 100644 --- a/tests/test_lingo.py +++ b/tests/test_lingo.py @@ -7,3 +7,15 @@ def test_indefinite_article() -> None: assert indefinite("über-Orc", 1) == "an über-Orc" assert indefinite("?", 1) == "a ?" assert indefinite("Rat", 1) == "a Rat" + + +def test_to_roman() -> None: + assert to_roman(0) == "N" + assert to_roman(-4) == "-IV" + assert to_roman(1994) == "MCMXCIV" + # pq-web aa37e4a: T = 10000, A = 5000 + assert to_roman(4000) == "MA" + assert to_roman(5000) == "A" + assert to_roman(9000) == "MT" + assert to_roman(14999) == "TMACMXCIX" + assert to_roman(23456) == "TTMMMCDLVI"