The main consideration is the lack of break statements. That means that if roman == Roman.X three switch statements will be executed:
- roman = Roman.C;
Now just loop through the code; I suggest you do it manually. Like this:
- start: x == 7, z == 2, roman == X
- iteration 1: roman == X so roman = C, z += 5, x++, and another z++. At the end, x == 8, z == 8 and roman == C
- iteration 2: ...
Renamed your Roman variable because the forum won't let me use its name outside code blocks.