# [Community Puzzle] Rotating arrows

Coding Games and Programming Challenges to Code Better

Created by @Mortis_666,validated by @Westicles,@ByteWolf1 and @radioctiv.
If you have any issues, feel free to ping them.

Hello I donâ€™t understand why my code donâ€™t validate validator 2 and it is not a hardcoding solution could you help me

Look if you are not inverting x and y.

3 Likes

Iâ€™m failing Validator 2 and 4 aswell, but canâ€™t find the edge case in my solution. what makes those Validators special?

You may consider generating random cases to test your code.

Try to invert x and y but only for the start position.

A chaque flĂ¨che, je tourne dans le sens des aiguilles dâ€™une montre et je passe Ă  la case suivante.
Ensuite je reviens au coordonnĂ©es de dĂ©part (0,0). Jâ€™ai donc fait un tour complet mais le rĂ©sultat est de 4 !
Parce que si je reviens au dĂ©part, je vais tourner indĂ©finiment, le rĂ©sultat est donc une boucle infinie et jâ€™obtiens un stack overflow !

Which case are you talking about?

I was considering the example where you turn around.
I miss understood the term â€śrotationâ€ť considering 360Â° instead of 90Â°.

I guess you rotate each time clockwise.
You move to the next position.
When you reach the starting point or you exit the grid, then you stop.
You can count the total number of translations which sould be equivalent to the number of 90Â° rotations.

Yes, you rotate the arrow clockwise by 90Â° at your current position, follow the direction of the rotated arrow and move to a new position, and repeat the process until you meet a stopping condition.

1 Like

Actually, one of the two stopping conditions.

Amended my answer, thanks for pointing out.

1 Like

At test cases are 4/4 green, but at validators only 1 pass!
How is this possible?!

Maybe you donâ€™t implement all the rules?

i also have the problem with the validators, can you please give some advice of what should i verify?

Send me your code in private, Iâ€™ll send back whatâ€™s wrong.

Hi @nicola
I had the problem of the validators NÂ°2 and 4 not validating too.
After seeing your answers here and reading again this puzzleâ€™s statement, i think maybe you should consider amending it ?
Like giving an example with differents x and y values, and/or inverting x and y in the informations of the second line of the data received.
Anyway, thanks for the help given here to the devs =)

I did not write the puzzle and I think that you have to read its statement carefully.