CS 15-212: Fundamental Structures of Computer Science II
In this lecture we give an example of modularity and code re-use by illustrating a generic game tree search algorithm. By carefully specifying the interface between the game and the search procedure, the code can be written very generally, yet still applied to a wide variety of games ("write once, play everywhere..."). We illustrate this through a very simple minimax game tree search algorithm, but the underlying concepts and techniques become even more important as the sophistication of the search algorithm increases. As a sample application, we use the code to implement a version of John Conway's Blue-Red Hackenbush game.