You are to create a program to play Tic-Tac-Toe.  The program should initially explain that this program is a Tic-Tac-Toe game. The program must include the following: The board must be represented as a one dimensional array. The board must be printed after each user selects a position on the board. Directions must be printed to the screen. The directions should include a copy of the board with each position labeled in the board.  The game should allow two players to alternate providing their selected position. The first player will be using ‘X’ and the second player will be using ‘Y’. The program should include the following functions: void printDirections ( ) Provides directions on how to play the game int getBoardPosition( int player) This function prompts for the player to input the position of the board and returns the position. void printBoard (char board [ ] ) This function prints the updated board with the input of the player. int isWinner ( char board [ ]) returns 0 if there is no winner and either 1 or 2 to indicate which player has won the game. The int main () should contain a loop to allow the inputting of board selection by the players and the printing of the updated board after each play.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter6: Using Arrays
Section: Chapter Questions
Problem 5E
icon
Related questions
Question

Problem Statement – You are to create a program to play Tic-Tac-Toe.  The program should initially explain that this program is a Tic-Tac-Toe game. The program must include the following:

  1. The board must be represented as a one dimensional array.
  2. The board must be printed after each user selects a position on the board.
  3. Directions must be printed to the screen. The directions should include a copy of the board with each position labeled in the board. 
  4. The game should allow two players to alternate providing their selected position. The first player will be using ‘X’ and the second player will be using ‘Y’.
  5. The program should include the following functions:
    1. void printDirections ( ) Provides directions on how to play the game
    2. int getBoardPosition( int player) This function prompts for the player to input the position of the board and returns the position.
    3. void printBoard (char board [ ] ) This function prints the updated board with the input of the player.
    4. int isWinner ( char board [ ]) returns 0 if there is no winner and either 1 or 2 to indicate which player has won the game.
    5. The int main () should contain a loop to allow the inputting of board selection by the players and the printing of the updated board after each play.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning