Not a sparrow question, but I was wondering how people represented boardgame boards (chess, checkers, etc.) in objective c in a way that made checking for valid moves relatively straightforward.
An array makes sense to me for something square (with a loop to check horizontal and vertical moves). Maybe the same would be done for diagonal moves?
What about where the shape is more like a diamond? Eg., row 1 has 4 boxes, row 2 has 5 boxes, row 3 has 6 boxes, row 4 has 5 boxes, row 5 has 4 boxes. Now valid moves are little more complicated. Box 1 of row 1 can move to box 1 and 2 of row 2. etc.
Is there a tried-and-true method for thinking about this? (maybe the fox&chicken guy has some thoughts...?)