Hardware Reference
In-Depth Information
correct_number = True
else:
print 'Square already occupied'
else :
print 'incorrect square try again'
def wipeBoard() :
global board
for square in range(0, len(board) ) :
board[square] = ' '
def printBoard():
print
print '|',
for square in range(0,9):
print board[square],'|',
if square == 2 or square == 5 :
print
print '- - - - - - -'
print '|',
print
print
def canMove(): # see if move can be made
move = False
for square in range(0, len(board) ) :
if board[square] == ' ':
move = True
return move
def checkWin(player,board):
win = False
for test in wins :
count = 0
for squares in test :
if board[squares] == player :
count +=1
if count == 3 :
win = True
return win
if __name__ == '__main__':
play()
Search WWH ::




Custom Search