top of page
Tic-Tac-Toe

 

Write a function that plays tic-tac-toe. Start by writing a sub-function called winner that can determine if one player or the other has won. Write a second sub-function called board that outputs a representation of the board. Then write a function called twoplayer that uses the winner and board functions and asks each player for the row and column where they want to put the X’s and O’s, terminating when the game is completed.
 
bottom of page