this post was submitted on 11 Oct 2025
269 points (99.6% liked)
Programmer Humor
26827 readers
1972 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It also works the other way round: wanna convert Arabic n to Roman? Just write n times ‘I’ and revert these replacement in inverse order.
I don't know what happens when the substring overlaps. Like for the number 6, will it replace the first 5 I's with V and end up correctly with VI or the last ones and come to IV? I would guess the former and maybe you know but I never thought about it before
Also does not handle 'IIIIIIIII' -> 'IX' properly
If the substitution went right to left it might work.