V.Vidhya Logo

V.Vidhya

Nested Array


Q1.

Assume we are making a tic-tac-toe game.

Now as the game progresses, we continuously need to keep track of the filled and unfilled cells of our grid. For that, create a 2D array to represent the following tic-tac-toe game state.

Image 1

Now let’s say that the next player put O in the first row at the middle position, so fill that slot with the given input in our array as well.


Prev Post
Array Methods II
Next Post
Array Cumulative