Re: [Tutor] programming tic tac toe

2008-08-21 Thread bob gailer
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

Re: [Tutor] programming tic tac toe

2008-08-21 Thread Lie Ryan
> 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=

Re: [Tutor] programming tic tac toe

2008-08-21 Thread Emile van Sebille
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

Re: [Tutor] programming tic tac toe

2008-08-20 Thread Alan Gauld
"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

[Tutor] programming tic tac toe

2008-08-20 Thread Ark
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] ==