Hi.
I programmed a simple tic tac toe game in python. I already finished it,
but I'm not pleased with the way I used to identify a line.
I used a list (with lists inside) to represent the board. And to identify a
winning line I used many if's, like this one:
def line(board):
if board[0][0] == board[1][1] == board[2][2]:
return True
...
...
return False
It's only an examble, but I did it that way.
I did not like using all those if's, and I would like to hear suggestions to
find a line in the board, maybe a more intelligent approach.
I would like a solution using lists because it would be useful for example
in C too, but I have been thinking about another way to represent a board.
Ark
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor