posted 11 years ago
Hi Brian, I got interested in this problem and decided to create the game for myself. I wrote a Board class that has a point-of-view the board can rotate to (so a certain Color's starting point is at the bottom of the screen, this makes it easy to write AIs for the game) and imposes a coordinate system relative to this point-of-view. When you want to access a position on the Board, it will transform the relative coordinates into the absolute array indices, and then access the array.
I wanted to provide you with a skeleton of the board class, but it may be more useful and educative if you see how it actually works. Please take the time to carefully read and understand the code, and let me know what you think.