this post was submitted on 11 Oct 2025
440 points (99.5% liked)
Programmer Humor
26875 readers
374 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
Does 9 really work? Wouldn't it be:
I like your questions about this and they all seem fair but I kinda wanna encourage you to go ahead and write it yourself; it’s a fun way to convert into Roman numerals that both is and isn’t intuitive at the same time.
No, cause you do the replacement from large to small, I.e. you’d first check for 10 I to replace with X (none found); then replace 9 with IX (check), then check for 5, 4 and so on.
The original doesn't have an extra check for 9 and it works for Roman->Indioarabic because it's:
But the other way around, you need an extra step for 9. That's where our misunderstanding comes from.
Ohhh haha that makes sense. Fun!
I noticed my “and so on” is literally a noop here so yeah.