

#Object agent := Agent(agent_x, agent_y, agent_dir)
#Object goal := GoalTile(goal_x, goal_y, 1)

#Policy main:   # This works for Empty
#    Execute go_to(goal)

Policy main:   # This is for DoorKey
    if yellow_key.x != -1:
        if not at(yellow_key):
            Execute go_to(yellow_key)
        else:
            Execute pickup


Plan main:  # This is a (better) plan for DoorKey
    Execute go_to_plan(yellow_key)
    Execute pickup
    Execute go_to_plan(yellow_door)
    Execute toggle
    Execute go_to_plan(goal)