On 22/07/2010 22:57, dcoder wrote:
== Quote from dcoder ([email protected])'s article
Hello. I want to use associative arrays, but have a 2-d int array as my
index. so something like:
string[int[][]] chessboard;
chessboard[[0,0]] = "Rook";
chessboard[[0,1]] = "Knight";
Is this possible? I can declare chessboard without any compiler complaints,
but I haven't figured out how to assign anything to it.
Any help would be appreciated.
thanks!
dcoder
Ooops, I just realized that int[someX][someY] needs to evaluate to an int, so
that
my statement above doesn't make any sense.
Still, is there anyway I can keep the spirit of a double index to a chessboard
without having to create a Coordinate object and define relational orderings?
thanks.
dcoder.
How about string[][]? ;)