Tic-tac-toe  is a paper-and-pencil game for two players who take turns marking the spaces in a three-by-three grid with X or O.