"naturalborncyborg" <[EMAIL PROTECTED]> wrote: > Hi, I'm using nested lists as arrays and having some problems with > that approach. In my puzzle class there is a swapelement method which > doesn't work out.
what happens, and what do you expect? > Any help and comments on the code will be appreciated. is it elements[y][x] or elements[x][y]? both variants seem to be used in your code. (fwiw, in this case, using a dictionary might be a lot easier. store cells as elements[x, y], use elements.get((x, y)) is None to check for empty cells, use elements[x, y] = None or del elements[x, y] to empty a cell, use elements = {} to clear all cells, etc). </F> -- http://mail.python.org/mailman/listinfo/python-list