Create a 2-Dimensional Grid for our Tic-Tac-Toe Game

InstructorKyle Shevlin

Share this video with your friends

Send Tweet

Tic-tac-toe, like many grid-based games, relies upon a 2-dimensional array data structure to hold the state of our grid.

A grid is a matrix. The outer array contains all the rows, and each row is an array of columns. Often each column value is referred to as a cell. In tic-tac-toe, we create a 3x3 grid of null values that will be replaced with Xs and Os as the user interacts with the game.