Write an interactive program that plays tic-tac-toe


Problem

Write an interactive program that plays tic-tac-toe. Represent the board as a three-by-three character array. Initialize the array to blanks and ask each player in turn to input a position. The first player's position will be marked on the board with an O, and the second player's position will be marked with an X. Continue the process until a player wins or the game is a draw. To win, a player must have three marks in a row, in a column, or on a diagonal. A draw occurs when the board is full and no one has won. Input each player's position in the form of an index into the tic-tac-toe board; that is, a row number, space, and column number. Make the program user friendly. After each game, print out a diagram of the board showing the ending positions. Keep a count of the number of games each player has won and the number of draws. Before the beginning of each game, ask each player whether he or she wishes to continue. If either player wishes to quit, print out the statistics and stop.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write an interactive program that plays tic-tac-toe
Reference No:- TGS02652878

Expected delivery within 24 Hours