Introduction to AI

AI plays a role in almost any kind of game you might want to write, and some non-game programs as well. For example, AI techniques are used to build smart apps that anticipate the user’s actions and learn based on heuristics and past behavior. Because users tend to project their own abilities into that of the program, it doesn’t take much to achieve the appearance of intelligence.

How AIs Work

Over the years, computer scientists have developed a number of ways to teach computers how to play games. One of the simplest is the minimax algorithm, named because it alternately tries to minimize or maximize the score depending on whose turn it is.

Gameplay is broken down into a sequence of plys, or half-turns. When the human moves, ...

Get Hello, Android, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.