Ark wrote:
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):
i
> Message: 1
> Date: Thu, 21 Aug 2008 06:53:50 +0100
> From: "Alan Gauld" <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] programming tic tac toe
> To: tutor@python.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; format=flowed; charset=
Ark wrote:
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):
i
"Ark" <[EMAIL PROTECTED]> wrote
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
I did not like using all those if's, and I would like
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] ==