lab24d - matrix to find a winner It checks for a horizontal...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab Goal : This lab was designed to teach you how to use a matrix, an array of arrays. Lab Description : Read in the values for a tic tac toe game and evaluate whether X or O won the game. Sample Data : 5 XXXOOXXOO OXOOXOXOX OXOXXOXOO OXXOXOXOO XOXOOOXXO Sample Output : X X X O O X X O O X wins horizontally! O X O O X O X O X cat's game - no winner! O X O X X O X O O O wins vertically! O X X O X O X O O X wins diagonally! X O X O O O X X O O wins horizontally! © A+ Computer Science – Matrices - algorithm help The determineWinner method goes through the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: matrix to find a winner. It checks for a horizontal winner first. Then, it checks for a vertical winner. Lastly, it checks for a diagonal winner. It must also check for a draw. A draw occurs if neither player wins. You will read in each game from a file and store each game in a matrix. The file will have multiple games in it. Computer Science I Lab 24D – TIC TAC TOE Lab Value - 100 # of data sets in the file - 5 Files Needed :: Lab24d.dat...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online