6Fermer8
ZerosquareLe 28/03/2019 à 21:17
I don't know what the specific problem with your code is, but I think you need to restructure it. At the moment it's very hard to read, and it will only get worse if you add more features later.

Try to use named constants, remove duplication (if very similar code appears more than one time, it's a sign you should create a function) and split up things into several lines so that you don't have complex expressions.

If you're stuck, testing your algorithm manually on grid paper can help you find the problems, too.