15-150: Principles of Functional Programming

Lecture 21: Implementing Game Playing

Today we implemented game players as functors that take particular games as arguments. We implemented depth-bounded minimax search, human players (code sketched in previous lecture), and a referee loop to supervise two players playing the same game.

Finally, we gave an overview of alpha-beta pruning.

Key Concepts

Sample Code

Notes on implementing game players

MiniMax slides from noon lecture

Alpha-Beta slides from noon lecture

Slides from 3pm lecture (with individual tree search steps)

Slides from 3pm lecture (abbreviated)

Code from 3pm lecture




(*) You don't need to know how sharing constraints work. We merely needed such constraints today, in order to ensure that both players are playing the same game.