as most school children knowtic-tac-toe is game played in three-by-three board two players-- and --alternate in placing their respective marks in the cells of this boardstarting with player if either player succeeds in getting three of his or her marks in rowcolumnor diagonalthen that player wins this is admittedly not sophisticated positional gameand it' not even that much fun to playsince good player can always force tie tic-tac-toe' saving grace is that it is nicesimple example showing how two-dimensional arrays can be used for positional games software for more sophisticated positional gamessuch as checkerschessor the popular simulation gamesare all based on the same approach we illustrate here for using two-dimensional array for tic--tac-toe (see exercise - the basic idea is to use two-dimensional arrayboardto maintain the game board cells in this array store values that indicate if that cell is empty or stores an or that isboard is three-by-three matrixwhose middle row consists of the cells board[ ][ ]board[ ][ ]and board[ ][ in our casewe choose to make the cells in the board array be integerswith indicating an empty cella indicating an xand - indicating this encoding allows us to have simple way of testing if given board configuration is win for or onamelyif the values of rowcolumnor diagonal add up to - or we illustrate this approach in figure figure an illustration of tic-tac-toe board and the two-dimensional integer arrayboardrepresenting it