mirror of
https://github.com/rr-/pq-cli.git
synced 2026-11-12 22:40:36 -07:00
lingo: extend roman numerals past 4000
This commit is contained in:
2 files changed
+17
No files matched your search
@@ -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")
|
||||||
|
|||||||
@@ -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"
|
||||||
Reference in new issue
Block a user