15-150: Principles of Functional Programming

Lecture 24: Theory and Applications


Introduction to Games

We discussed two-player, deterministic, perfect-information, finitely branching, zero-sum games. We presented a signature for such games and showed how to implement the game of Nim.

We implemented game players as functors that take particular games as arguments. We implemented depth-bounded minimax search, human players, and a referee loop to supervise two players playing the same game.

Key Concepts

Sample Code (In order to run this code, first load sequences.)

Notes on game players

Slides from Lecture