How to double the size of 8x8 Grid whilst keeping the relative position of certain tiles intact?

Posted by ke3pup on Stack Overflow See other posts from Stack Overflow or by ke3pup
Published on 2010-04-26T09:50:47Z Indexed on 2010/04/26 9:53 UTC
Read the original article Hit count: 210

Filed under:
|

Hi guys I have grid size of size 8x8 , total of 64 Tiles.

i'm using this Grid to implement java search algorithms such as BFS and DFS.

The Grid has given forbidden Tiles (meaning they can't be traversed or be neighbour of any other tile) and Goal and Start tile. for example Tile 19,20,21,22 and 35, 39 are forbidden and 14 an 43 are the Goal and start node when the program runs.

My question is , How can i double the size of the grid, to 16x16 whilst keeping the Relative position of forbidden tiles as well as the Relative position of start and goal Tiles intact?

On paper i know i can do this by adding 4 rows and columns to all size but in coding terms i don't know how to make it work? Can someone please give any sort of hints?

© Stack Overflow or respective owner

Related posts about java

Related posts about programming-languages