![]() |
CS 391 Selected Topics: Game AI Homework #2 |
Note: This work is to be done in groups of 2. Each group will submit one assignment. Although you may divide the work, both team members should be able to present/describe their partner's work upon request.
0. HW2 Preparation: Download the HW2 starter code here.
1. Chutes and Ladders: Chutes and Ladders is a popular Milton Bradley/Hasbro version of the ancient children's board game Snakes and Ladders.
The board c consists of 100 numbered squares arranged in a 10-by-10 grid. The winner is the first player to reach square 100. Players start with their playing pieces off the board near square one. (Imagine starting at square 0.) Players take turns spinning a spinner with numbers 1 - 6. After spinning, one advances one's piece according to the number of the spin. (Exception: If this would take one beyond square 100, one does not advance at all. Square 100 must be reached by exact count.) Some squares depict the beginning of a chute or ladder. After advancing to such a space, one slides the piece down the chute or climbs the piece up the ladder. If, after advancing and/or climbing, a player's piece is on square 100, the player wins and the game is over. Here is a table describing the chutes and ladders of the 2004 edition:
| From Square | To Square |
|---|---|
| 1 | 38 |
| 4 | 14 |
| 9 | 31 |
| 16 | 6 |
| 21 | 42 |
| 28 | 84 |
| 36 | 44 |
| 48 | 26 |
| 49 | 11 |
| 51 | 67 |
| 56 | 53 |
| 62 | 19 |
| 64 | 60 |
| 71 | 91 |
| 80 | 100 |
| 87 | 24 |
| 93 | 73 |
| 95 | 75 |
| 98 | 78 |
Using Value Iteration, compute the expected number of turns remaining in solitaire Chutes and Ladders from each board position, printing the result according to given format of the starter code.
Representation:
Self-check:
Highlight the following to see if your first line of output is correct: Expected turns per game: 39.60
2. Boosted Chutes and Ladders: For Boosted Chutes and Ladders, we modify the game to allow a play a simple choice each turn: After the spin of s the player may choose to either move s or (s + 1) positions, and thus transition to either position goesTo[p + s] or position goesTo[p + s + 1]. (Goal movement exceptions still apply.)
Assuming an optimal player that maximizes V and thus minimizes turns, use Value Iteration to compute the expected number of turns remaining in solitaire Boosted Chutes and Ladders from each board position, printing the result in the same format as above.
Self-check:
Highlight the following to see if your first line of output is correct: Expected turns per game: 14.50
3. Token Boosted Chutes and Ladders: We modify standard Chutes and Ladders by giving a player three tokens. After a spin, the player may spend a token to "boost" the spin as in the previous variant. In other words, a player is permitted three boosts over the course of the game.
Assuming an optimal player that maximizes V and thus minimizes turns, use Value Iteration to compute the expected number of turns remaining in solitaire Token Boosted Chutes and Ladders from each board position, printing the result in the same format as above, but printing separate boards for each possible number of remaining tokens.
Representation:
Self-check:
Highlight the following to see if your first line of output is correct: Expected turns per game: 18.25
Note that you are not being asked to explicitly compute or print optimal policy in the last two exercises. A player could look at these tables and infer the optimal actions by taking the action that would minimize the expected number of turns to the goal.