Wyo VB Ch5Proj1

Write a program that allows two players to play a game of Tic Tac Toe. Use a module-level two-dimensional array to keep track of the logic of the game. Do not allow one player to overwrite the other player's X or O. Provide a File/Exit menu command as well as a File/New Game menu command that allows a new game to be played with player X making the first move. The computer must detect the end of the game and indicate somehow which player won the game (X or O) or if the game ended in a draw. You may use the TicTacToe program in the Handout folder as a beginning point. However, you are encouraged to make your version more user-friendly. Perhaps, you'll allow the user to click on a region of the form in order to select his/her move rather than to type in row and column numbers. Of course, you are encouraged to make the program look better with color and graphics.

Hints: Use your own method named checkForWinOrDraw to efficiently check for a win or draw each time someone makes a move. If you allow the players to click on regions of the form rather than X & Y buttons, use a module-level variable to keep track of whose turn it is.

Preconditions:

  • None

Your program must follow standard Windows conventions as well as our school's Visual Basic Coding Standards. Name your project Ch5Proj1.

Staple & submit your printouts in the following order:

  1. VB code
  2. The screen capture of your actual form window at runtime showing a win or draw.