[Community Puzzle] These Romans are crazy!

Any hint with validator 3? All the tests pass and I’ve tried a lot of edge cases up to 4999, can not find the error with Val 3. Thanks!

Haven’t done this puzzle yet on CG so I cannot access the validator and I’m on my phone so it will be complicated to solve it from here but a general advice:
The key to avoid all edge cases for this one is to list all numbers that have a special written form in decreasing order:
1000, 900, 500, 400, etc.
Then for your decimal->roman converter you only need successive integer divisions by the numbers from your list.
The roman->decimal is easy to do at this point, just use the same list and reverse the process.
It should handle all edgecases.
And once your 2 converters are ready to go, the puzzle is basically over.

2 Likes

Thanks for the help, found it by giving it a list of edges cases. Wasn’t processing 49 correctly.

1 Like

Hello,

I fail at validator 4 when i submit my code but i don’t know why.
Can i have some help ?

Have you tried your code on all the numbers from 1 to 4999? It should not be too difficult to test all the major patterns out :wink:

1 Like

@cilheo Did you figure out why you failed on Validator 4? I also failed it. I didn’t read the spec carefully (shame on me) and I only wrote my code to handle numbers up to 3999, the limit for Roman Numerals without the use of a vinculum according to EnglishHistory.net.

You either failed because you cannot handle numbers above 4000 or because you make LXL of a 90 instead of XC.