Skip to content

Commit b66b956

Browse files
committed
Add marker helper (not currently used)
1 parent e53ffad commit b66b956

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
def build_quasiroman_arrow(n: int) -> str:
2+
# Simple Roman numeral conversion using only I, V, and X
3+
roman_parts = []
4+
num = n
5+
roman_parts.extend(["M"] * (num // 1000)) # Add 'X' for each multiple of 10
6+
num %= 1000
7+
roman_parts.extend(["D"] * (num // 500)) # Add 'X' for each multiple of 10
8+
num %= 500
9+
roman_parts.extend(["C"] * (num // 100)) # Add 'X' for each multiple of 10
10+
num %= 100
11+
roman_parts.extend(["L"] * (num // 50)) # Add 'X' for each multiple of 10
12+
num %= 50
13+
roman_parts.extend(["X"] * (num // 10)) # Add 'X' for each multiple of 10
14+
num %= 10
15+
roman_parts.extend(["V"] * (num // 5)) # Add 'V' for each multiple of 5
16+
num %= 5
17+
roman_parts.extend([r"/"] * num) # Add 'I' for the remainder
18+
19+
# Join with " \! " to form the arrow-like structure
20+
res = "$" + r" \! ".join(roman_parts) + r" \! $-$\!\!\guilsinglright$"
21+
print(n, res)
22+
return res

0 commit comments

Comments
 (0)