Game Development Reference
In-Depth Information
170. # Computer's turn.
171. move = getComputerMove(theBoard,
computerLetter)
172. makeMove(theBoard, computerLetter, move)
173.
174. if isWinner(theBoard, computerLetter):
175. drawBoard(theBoard)
176. print('The computer has beaten you! You
lose.')
177. gameIsPlaying = False
178. else:
179. if isBoardFull(theBoard):
180. drawBoard(theBoard)
181. print('The game is a tie!')
182. break
183. else:
184. turn = 'player'
185.
186. if not playAgain():
187. break
Designing the Program
Figure 10-1: Flow chart for Tic Tac Toe
Search WWH ::




Custom Search