Re: If Statement Error (Tic Tac Toe)

2005-11-02 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > The only problem I have is whenever player two goes, it says the cell > is filled. But the code: > > if gameboard[cell] not in 'OX': >gameboard[cell] = 'X' >else: >print "This cell is already filled." >turnnu

Re: If Statement Error (Tic Tac Toe)

2005-11-02 Thread Mike Meyer
[EMAIL PROTECTED] writes: > The code's indentation was fine - I forgot to declare cell in player > two's section and not just in player one. > > The code (including the win check, for once!) is working. The last > obstacle is my tie checker; it doesn't seem to like what I have: > > if ((gameboard

Re: If Statement Error (Tic Tac Toe)

2005-11-02 Thread ale . of . ginger
The code's indentation was fine - I forgot to declare cell in player two's section and not just in player one. The code (including the win check, for once!) is working. The last obstacle is my tie checker; it doesn't seem to like what I have: if ((gameboard[0:9] is 'X' or 'O') and (win == 0)):

Re: If Statement Error (Tic Tac Toe)

2005-11-02 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >Greetings! I am trying to make a multiplayer (no AI, 2 person) game of >tic tac toe in Python. So far it has been pretty simple. My only >concern is with the win checking to see if a person has won. At first >it looked like it was wor

Re: If Statement Error (Tic Tac Toe)

2005-11-02 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Nevermind my previous reply: I've been fixing up the code and > understand it. I'm at a nifty 80 lines where I am at now rather than > 209 lines in the previous version! The changes are immense! > > The only problem I have is whenever player two goes, it says the cell

Re: If Statement Error (Tic Tac Toe)

2005-11-01 Thread ale . of . ginger
Nevermind my previous reply: I've been fixing up the code and understand it. I'm at a nifty 80 lines where I am at now rather than 209 lines in the previous version! The changes are immense! The only problem I have is whenever player two goes, it says the cell is filled. But the code: if gameb

Re: If Statement Error (Tic Tac Toe)

2005-11-01 Thread ale . of . ginger
So is there a way I have to set up the string OX in the beginning? Is this where it houses the location of the Xs and Os to determine whether or not a letter is already there? -- http://mail.python.org/mailman/listinfo/python-list

Re: If Statement Error (Tic Tac Toe)

2005-11-01 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Thank you. It seems I didn't understand logic statements as much as I > thought I did! > > The one remaining question I have deals with this: > > if gameboard[cell] not in 'OX': > gameboard[cell] = 'O' > else: > print "This cell is already filled."

Re: If Statement Error (Tic Tac Toe)

2005-11-01 Thread ale . of . ginger
Thank you. It seems I didn't understand logic statements as much as I thought I did! The one remaining question I have deals with this: if gameboard[cell] not in 'OX': gameboard[cell] = 'O' else: print "This cell is already filled." turnnumber -= 1 (gameboard[cell]

Re: If Statement Error (Tic Tac Toe)

2005-11-01 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Greetings! I am trying to make a multiplayer (no AI, 2 person) game of > tic tac toe in Python. So far it has been pretty simple. My only > concern is with the win checking to see if a person has won. At first > it looked like it was working, but now it sometimes as

RE: If Statement Error (Tic Tac Toe)

2005-11-01 Thread Delaney, Timothy (Tim)
This site will help you get a useful answer: http://www.catb.org/~esr/faqs/smart-questions.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list