Question: Develop a Windows application using C# .Net that simulates a game of tic-tac-toe. The application should use a two-dimensional array to simulate the game board

Develop a Windows application using C# .Net that simulates a game of tic-tac-toe. The application should use a two-dimensional array to simulate the game board in memory, which will be reflected on the form using nine large Label controls to display the Xs and Os. The application should display a message indicating whether player X won, player Y won, or the game was a tie. The application shall also track the winner of multiple plays of the game.

Write the proper event procedures (i.e. code) that:

a. Displays X (in green background) or O (in red background) on the label clicked by the user, based on the player’s turn, and disable the clicked label in order not to allow changing it!

b. Checks for winner in rows, columns and diagonals

c. Displays “It was a tie!” in case of no winner.

d. Start a new game

e. Lists the winners of multiple plays of the game in a winnerListBox

f. Close the form and exit the application

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is the C code for a Windows application simulating tictactoe C using System using SystemCollectionsGeneric using SystemComponentModel using Syste... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!