Rooks Movements

Thanks to Thibaud I was able to solve the puzzle.
For everyone who faces the same problem: Check what your program does when you have opponent pieces in both vertical and horizontal directions. Remember that the output always has to be in lexicographical order.

I’ve passed all the IDE tests but having an issue passing the validators “CLOSE TO THE EDGE 2” and “FOR FRODOOO 2” I’ve tried various starting positions for the rook near the board edges - corners, halfway points, and the output produced appears valid and I cannot figure out whats causing the validator fail, anyone have any ideas?

At the moment I consider tests for its puzzle is broken (see screenShot).CodeGame_Rook
It is impossible to pass.

The test is correct, the output section says “action should be x if the movement involves taking an opponent pieces, - otherwise”.

Agree. Thanks

Hi I have the same problem… Can you help me with FOR FRODOOO 2? Whatever I try it’s always the correct lexographical output.

In the first lines you should output where you can move to, in lexographical order. After that you should output where you can capture opponents, also in lexographical order. I recommend you to create a custom test scenario where you have multiple opponents which you can capture. Place the opponents in all possible directions and always check that the output respects the lexographical order.

1 Like

Hi, is there any way to see what a test case is? I am failing on FOR FRODOOO 2, but despite trying a load of custom tests I can’t find where the bug is.

What’s your output for this custom testcase:
1 e2
1 g4
1 g1
1 h2


1 Like

Thanks, I was missing Rg2-f2 and Rg2xe2. I had missed the condition where there was both a blocking piece on the right and left of the rook. I have 100% now :white_check_mark: