Docsity

Implement a Search Algorithm to Find a Path Through a Maze | COMP 151, Assignments of Computer Science

Toggle sidebar
bg1
COMP151 Spring 2007 Assignment 1 due Feb 7, 2007
Implement a search algorithm to find a path through a maze.
The maze world is a grid of cells. Each cell in the grid is either passable or impassable. Possible
actions are: move up, move down, move right and move left. It is not legal to move into an
impassable cell. It is not legal to move off the grid.
Your program should be able to solve general mazes, but you must demonstrate that it can solve
the following maze:
XXXXXXXXXXXXXXXXXX
XX..........XXXGXX
XX..XX.XXXXXXXX.XX
XXXX.....XXXXXX.XX
XXXX.XX..XXXXXX.XX
XXXX.XX.........XX
X....XXXXXXXXXXXXX
XXXX...........XXX
XXXXXXXXXXXXXX..SX
XXXXXXXXXXX....XXX
In this maze, โ€˜Xโ€™ is an impassable cell, โ€˜.โ€™ is a passable cell, โ€˜Sโ€™ is the start cell (initial position) and
โ€˜Gโ€™ is the goal cell.
You may implement your solution any programming language. You may reuse code or algorithms
from any source (including the textbook website http://aima.cs.berkeley.edu/code.html) as long as
you give an appropriate citation indicating the source of reused code.

Partial preview of the text

Download Implement a Search Algorithm to Find a Path Through a Maze | COMP 151 and more Assignments Computer Science in PDF only on Docsity!

COMP151 Spring 2007 Assignment 1 due Feb 7, 2007 Implement a search algorithm to find a path through a maze. The maze world is a grid of cells. Each cell in the grid is either passable or impassable. Possible actions are: move up, move down, move right and move left. It is not legal to move into an impassable cell. It is not legal to move off the grid. Your program should be able to solve general mazes, but you must demonstrate that it can solve the following maze: XXXXXXXXXXXXXXXXXX XX..........XXXGXX XX..XX.XXXXXXXX.XX XXXX.....XXXXXX.XX XXXX.XX..XXXXXX.XX XXXX.XX.........XX X....XXXXXXXXXXXXX XXXX...........XXX XXXXXXXXXXXXXX..SX XXXXXXXXXXX....XXX In this maze, โ€˜Xโ€™ is an impassable cell, โ€˜.โ€™ is a passable cell, โ€˜Sโ€™ is the start cell (initial position) and โ€˜Gโ€™ is the goal cell. You may implement your solution any programming language. You may reuse code or algorithms from any source (including the textbook website http://aima.cs.berkeley.edu/code.html) as long as you give an appropriate citation indicating the source of reused code.