lingo: extend roman numerals past 4000

This commit is contained in:
Dash committed 2026-10-17 15:55:49 +02:00
1 parent 48f48aec58
commit c25f9dc057
2 files changed
+17

No files matched your search

+5
View File
@@ -55,6 +55,11 @@ def to_roman(num: int) -> str:
ret = "-" ret = "-"
num = -num num = -num
while _rome(10000, "T"):
pass
_rome(9000, "MT")
_rome(5000, "A")
_rome(4000, "MA")
while _rome(1000, "M"): while _rome(1000, "M"):
pass pass
_rome(900, "CM") _rome(900, "CM")
+12
View File
@@ -7,3 +7,15 @@ def test_indefinite_article() -> None:
assert indefinite("über-Orc", 1) == "an über-Orc" assert indefinite("über-Orc", 1) == "an über-Orc"
assert indefinite("?", 1) == "a ?" assert indefinite("?", 1) == "a ?"
assert indefinite("Rat", 1) == "a Rat" 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"