Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

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

Material Type: Assignment; Class: Artificial Intelligence; Subject: Computer Science; University: University of the Pacific; Term: Spring 2007;

Typology: Assignments

Pre 2010

Uploaded on 08/17/2009

koofers-user-akc
koofers-user-akc 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

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.