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

Chapter 5Ghost in the Machine

So far we’ve created a game that lets the user make moves by touching the screen and alternating between the X and O players. In this chapter we’re going to turn Tic-Tac-Toe into a single-player game, where the human makes a move and the computer responds.

To do this, we need to teach the app how to evaluate positions on the game board and choose the best move from all the ones available. This will require that we take a quick detour into the world of AI (artificial intelligence).

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