Skip to main content
This is the in-class activity for Tuesday February 15.
The materials that you will need for this in-class activity are:

In Class Activity: Search Algorithms for Action Castle

Today in class we will walk through how to use search algorithms like Breadth-First Search (BFS) to solve text adventure games like Action Castle.

In order to do so, we’ll need to figure out:

  1. How to represent the state space for the game.
  2. How to list the possible moves at each turn in the game.
  3. How to use each possible move to generate a successor state.
  4. How to test whether we have reached the goal.

We’ll implement three functions that will allow us to use BFS to find the best sequence of commands in order to complete the game that we implemented in Homework 1.

What to do

  1. Open Search Algorithms for Action Castle.ipynb.
  2. Save a copy of it in your own drive by choosing File > Save a Copy in Drive from the Colab menu. This will ensure that your changes are saved.
  3. Implement the following functions:
    • get_state
    • get_available_actions
    • goal_test
  4. Please submit your work to Gradescope by Monday, February 21, 2022 before 11:59PM.