O'Reilly logo

Hello, Android, 4th Edition by Ed Burnette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the Tic-Tac-Toe Example

Everybody knows how to play Tic-Tac-Toe: a 3×3 array of tiles, initially empty, is filled in by two players who mark either an X or an O in an empty spot. The first player to get three of their marks in a row wins. If the board fills up first, then that’s a tie and nobody wins.

Ultimate Tic-Tac-Toe[28] is similar, except that you can’t simply put a mark in your square—you have to win the square by playing a nested game of Tic-Tac-Toe using a 3×3 array of smaller tiles inside the big one. See the figure for an example.

images/fig.gameactivity.png
Figure 2. Tic-Tac-Toe meets Inception

There are many variations, but we’re going to use the one ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required