Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
As we discussed when we were designing the game tree code for Dice of Doom, having a separate game tree generator makes it easy to add an AI player to a game engine. In fact, we’re now going to add a computer player that can play an absolutely perfect game with only 23 additional lines of code!
So how does an AI player decide to make a move? We’ll use the following strategy: