Hi guys,
I am wanting to create a schema that stores a chessboard. Seeing how a chessboard is somewhat like a grid or table (a two-dimensional object), I thought that we could use each point on the grid to store the piece value, and then index the values at each specific point in the 8x8 grid.
Basically the X-axis would represent ranks 1-8 in chess and the Y-axis would represent files A-H in chess.
This is not a valid query, but I thought maybe something like this might be what I wanted:
# board[0][0] would represent A8, board[7][7] would represent H1, etc
# there would be 13 possible values: K Q R B N P k q r b n p -
SELECT * FROM mytable WHERE board[0][0] = 'r';
So I was wondering if anyone had any ideas they could share. From what I can see, the GEOMETRY type might be my best bet, but I spent a bit of time on Google and found no examples of its use.
Thanks,
- John