August 2021
Intermediate to advanced
384 pages
9h 15m
English
In the one-player version of Connect Four we built in Chapter 11, the computer always randomly selects a move. This allowed us to focus on the game’s speech recognition and text-to-speech aspects.
However, once you play against the random computer for a few games, you start to wonder if there’s a way to make our Connect Four game more challenging. The answer is yes, and in this chapter, you’ll learn to make an intelligent Connect Four opponent.
In one approach, we’ll ask the script to think three steps ahead, as people do when playing a game: two moves by the computer and one by the player.
In the first ...
Read now
Unlock full access