Changeset 9566

Show
Ignore:
Timestamp:
05/03/08 18:50:16 (7 months ago)
Author:
bct
Message:

made compatible with python 2.4

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/session_centric/src/tictactoe.py

    r9535 r9566  
    271271                        # vertical check 
    272272                        try: 
    273                                 tallyI = tallyI + 1 if self.board[r+d][c] == p else 0 
     273                                tallyI = tallyI + 1 
     274                                if self.board[r+d][c] != p: 
     275                                        tallyI = 0 
    274276                        except IndexError: 
    275277                                pass 
     
    277279                        # horizontal check 
    278280                        try: 
    279                                 tally_ = tally_ + 1 if self.board[r][c+d] == p else 0 
     281                                tally_ = tally_ + 1 
     282                                if self.board[r][c+d] != p: 
     283                                        tally_ = 0 
    280284                        except IndexError: 
    281285                                pass 
     
    283287                        # diagonal checks 
    284288                        try: 
    285                                 tallyL = tallyL + 1 if self.board[r+d][c+d] == p else 0 
     289                                tallyL = tallyL + 1 
     290                                if self.board[r+d][c+d] != p: 
     291                                        tallyL = 0 
    286292                        except IndexError: 
    287293                                pass 
    288294 
    289295                        try: 
    290                                 tallyF = tallyF + 1 if self.board[r+d][c-d] == p else 0 
     296                                tallyF = tallyF + 1 
     297                                if self.board[r+d][c-d] != p: 
     298                                        tallyF = 0 
    291299                        except IndexError: 
    292300                                pass