General Game Playing
Assignment 2
General
Artificial
Intelligence

Lessons Notes Videos Readings Resources Arena

This week, you should read Chapters 3 - 6 in the Notes. And you should do the exercises at the ends of the chapters!

In this assignment and the assignments that follow, your job is to create a variety of different game players, as described below. When you are happy with these players, click on the links below to test them out. Check that the Address on each page is set correctly for your player (as described below), press Setup to initialize the game, then press Start to set it going. After each match is complete, click the "Record" button to record your score in the class database. If you do this more than once, the latest score will overwrite any earlier scores.

Note that the the tasks for this assignment and most of those that follow require that you enter a URL for your player before you set up the match. (1) If you are running your player on the same machine as your browser, this is easy. As URL, you just enter your local address followed by a colon followed by the port on which your player is running, e.g. http://127.0.0.1:9147. (2) If your player is running on same network as your browser, again things are easy. You can use your player's local network address followed by a colon and the port number e.g. http://10.1.71.18:9147. (3) If your player is running on a different machine and if that machine has a public IP address, you can use that address followed by a colon and your port number e.g. http://egghead.com:9147. (4) Unfortunately, if your player is not running on the same machine or the same network as your browser and you do not have a public IP address, things are more complicated. One solution in this case is to use ngrok. Click here for details. However, we do not recommend this if it can possibly be avoided. If you do not have a public IP address, it is best to run your browser and player on the same machine or the same network when doing these exercises.


  1. Create a legal player. Once your player is ready to go, click on the links below to test it out.

  2. Hunter
    Tic Tac Toe as X
    Tic Tac Toe as O

  3. Create a random player. Once your player is ready to go, click on the links below to test it out.

  4. Hunter
    Tic Tac Toe as X
    Tic Tac Toe as O

  5. Implement a compulsive deliberation player for single player games that searches the entire game tree on each step. Your player should be capable of playing games like Buttons and Lights, Three Puzzle, and so forth with a start clock of 10 seconds and a play clock of 10 seconds. Once your player is ready to go, click on the links below to test it out.

  6. Buttons and Lights
    Three Puzzle

  7. Implement a minimax player for multiple player games. Your player should be capable of playing games like Tic Tac Toe 3 (Tic Tac Toe with only 3 open squares), Tic Tac Toe 5, Tic Tac Toe 7, and maybe even full Tic Tac Toe with a start clock of 10 seconds and a play clock of 20 seconds. Your player should work on the simplest of these games at the very least, e.g. Tic Tac Toe 3. The more it can win (or at least not lose), the better. Once your player is ready to go, click on the links below to test it out.

  8. Tic Tac Toe 3
    Tic Tac Toe 5
    Tic Tac Toe 7
    Tic Tac Toe

  9. Implement an alphabeta player for multiple player games. Your player should be capable of playing games like Tic Tac Toe 3 (Tic Tac Toe with only 3 open squares), Tic Tac Toe 5, Tic Tac Toe 7, and maybe even full Tic Tac Toe, all with a start clock of 10 seconds and a play clock of 20 seconds; and it should be faster than your minimax player. Once your player is ready to go, click on the links below to test it out.

  10. Tic Tac Toe 3
    Tic Tac Toe 5
    Tic Tac Toe 7
    Tic Tac Toe

  11. Comparison. Create one process running your alphabeta player and a separate process running your minimax player. Once your players are ready, go to Arena, click on Games, click on one of the Tic Tac Toe games, click Manage a Match, enter names and addresses for your players, and have them compete against each other. If both play perfectly, try decreasing the play clock. Is there a point at which alphabeta begins to win reliably or do they remain effectively equivalent on these games? Check the number of nodes explored by each of the two players. Is there a difference?

Comments and complaints to genesereth@stanford.edu.