Skip to content

Commit

Permalink
Add marker helper (not currently used)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmore500 committed Nov 20, 2023
1 parent e53ffad commit b66b956
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions conduitpylib/viz/_build_quasiroman_arrow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
def build_quasiroman_arrow(n: int) -> str:
# Simple Roman numeral conversion using only I, V, and X
roman_parts = []
num = n
roman_parts.extend(["M"] * (num // 1000)) # Add 'X' for each multiple of 10
num %= 1000
roman_parts.extend(["D"] * (num // 500)) # Add 'X' for each multiple of 10
num %= 500
roman_parts.extend(["C"] * (num // 100)) # Add 'X' for each multiple of 10
num %= 100
roman_parts.extend(["L"] * (num // 50)) # Add 'X' for each multiple of 10
num %= 50
roman_parts.extend(["X"] * (num // 10)) # Add 'X' for each multiple of 10
num %= 10
roman_parts.extend(["V"] * (num // 5)) # Add 'V' for each multiple of 5
num %= 5
roman_parts.extend([r"/"] * num) # Add 'I' for the remainder

# Join with " \! " to form the arrow-like structure
res = "$" + r" \! ".join(roman_parts) + r" \! $-$\!\!\guilsinglright$"
print(n, res)
return res

0 comments on commit b66b956

Please sign in to comment.