- Joined
- Mar 24, 2013
- Messages
- 1,105
The map is a slightly tweaked version of tic-tac-toe.
The gameboard starts out as a grid 3x3 and each time a player marks a spot they increase the size of the board by one tile by adding a new space that connects to the current board on a full side (not diagonally).
My issue is catching when the player makes the move that gets them 4 in row, either up/down, left/right or diagonally are the possible ways to get it.
There is no guarantee that the last spot that completes the chain of 4 will be at the end of the chain. ( it could a middle spot that competes the chain of 4.)
My current plan is to check everytime the player makes a move and search for a 4 in a row chain in a 7x7 area around the newly marked spot. However, this would be something like 60 combinations to check everytime and I feel that there must be a better way.
Thanks for any feedback
The gameboard starts out as a grid 3x3 and each time a player marks a spot they increase the size of the board by one tile by adding a new space that connects to the current board on a full side (not diagonally).
My issue is catching when the player makes the move that gets them 4 in row, either up/down, left/right or diagonally are the possible ways to get it.
There is no guarantee that the last spot that completes the chain of 4 will be at the end of the chain. ( it could a middle spot that competes the chain of 4.)
My current plan is to check everytime the player makes a move and search for a 4 in a row chain in a 7x7 area around the newly marked spot. However, this would be something like 60 combinations to check everytime and I feel that there must be a better way.
Thanks for any feedback