I’m trying to bring a board game to the computer world, and the board consists of 16 spaces, 6 for each side and 4 in the middle. The board is diamond-shaped and two ends represent both team bases. In the game, peices only move foward towards the enemy”s base (with special abilities of course). So here is my question: what do you think is the best data structure to represent the game board? The first thing that came to my mind was a tree, but I really don’t like the idea because there would be two “roots”. Any suggestions?
The board looks like this:
&
& &
& & &
* * * *
$ $ $
$ $
$
so the & team can only move towards the $ team and vice-versa, * being neutral territory
Is it essentially a square? The diamond shape just a matter of interpretation? Like so ..
if so, maybe just use a 2D array, and use your display system to ‘turn it’ into a diamond.
edit
I think you can map you move set to the array – If your ‘$’ pieces only move up-and-left or up-and-right, that is akin to my ‘B’ pieces moving only ‘up’ or ‘right’. Similary, if the ‘&’ pieces only move down-and-left or down-and-right, that’s like the ‘A’ pieces only moving down or left.
The idea is that, internal to the program, think of your data ‘up and down’, but when you present your game state to your user, just draw it in the diamond configuration.