2.6 Playing Games
All games have one or more goals and rules for players to follow. Think about your favorite game and recall when you first learned to play that game. It might have been hide-and-seek, a sport like baseball, checkers, a card game like Go Fish, or a video game. You might have watched others play and surmised some of those goals or rules, but more likely you asked someone, “How do you play?”
Now, imagine you are the one explaining that game to a new friend. You need to define the goals and to outline the rules clearly to your friend. Computers are no different. Recall that the field of artificial intelligence (AI) involves two major approaches: rules based and learned patterns (“machine learning”). Computers can “learn” a game ...
Get Python Programming in Context, 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.