shinsen sho

Miscellaneous Forums/General Discussion/shinsen sho

How did I make it count corners? Drew a lot of diagrams!!
It's easier if you only have to check one way so if the first tile selected was below the second I swapped them round so I always checked from top to bottom. Then I ran through a series of checks - if they didn't match the first try the next.
Tiles next to each other horizontally, vertically or diagonally (with a blank making up the square) match. Tiles which have no tiles between them and the same edge of the screen match. Starting from tile 1 check for blank squares horizontally until you are directly above tile 2 then check downwards. Then repeat from below tile 1 downwards until you are level with tile 2 and check sideways. The final check involves looking for a path from the side of tile 1 past tile 2 then moving down the screen until it's level and moving back inwards. It has to be level or there will be 2 many corners. You have to check both sides of tile 1 and also start from below tile 1 moving downwards, sideways and then down again. And also from below tile 1, down past tile 2, across and then up. It was all done with while/wend loops.
Actually I found drawing things out made life a lot simpler.
Regards