383
you are viewing a single comment's thread
view the rest of the comments
[-] lugal@lemmy.dbzer0.com 6 points 21 hours ago

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

[-] rooroo@feddit.org 1 points 3 hours ago

I’ve written it that way and it works, as in it will replace left to right and you replace iiii to iv after iiiii to v

[-] Atlas_@lemmy.world 5 points 17 hours ago

Also does not handle 'IIIIIIIII' -> 'IX' properly

[-] pitiable_sandwich540@feddit.org 2 points 13 hours ago

If the substitution went right to left it might work.

this post was submitted on 11 Oct 2025
383 points (100.0% liked)

Programmer Humor

26827 readers
1889 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

founded 2 years ago
MODERATORS