Computer Science 102

Lab 11

In this lab you will you will complete the maze.c program. The program uses C++ input and output so it must be compiled with g++, but it uses no C++ classes. You will have to complete three functions.

Additional detail may be found in pages 108-115 of raysystem2.pdf

/* Determine if it is legal to step to location (y, x) */

/* It is ILLEGAL if (y, x) has already been visited or */

/* if it lies outside the maze */

int legal_move(

int desty, // potential destination for next step

int destx)

{

}

/* Print the complete path from the start to the finish */

/* Use the format shown in the notes */

void print_path(

int len) // end to end path length

{

}

/* recursively attempt to build a path from current */

/* start location (y, x) to (targety, targetx) */

/* Each invocation of this function adds AT MOST */

/* ONE NEW ELEMENT to the path. */

int build_path(

int pathlen, // current pathlen

int y, // segment start location

int x)

{

}

Be sure to disable all diagnostic prints before you submit.

In this lab you will submit a single file, maze.c that includes the new and updated class methods constructed as part of this lab.

sendlab.102.labsection# lab# list.cpp

Mike Westall

2007-01-17T09:19:32

Mike Westall