A CS1 Maze Lab, using Joysticks and MIPPETs
Don Stone, Seth Bergmann, Ganesh Baliga, Michael Berman, and John Schmalzel
Rowan University,
Glassboro, NJ
In what context is the maze lab used?
The maze lab is given to students as an exercise in a closed
lab in roughly the middle of a CS1 course taught in C++.
What is supplied to the student for the maze lab?
The student is given a maze class, whose constructor generates
and displays a random maze of the specified size. A maze object has
a current position (initially the upper left cell), and the current position
can be changed only by the move member function.
What does the student do in the maze lab?
The lab specification asks the
student to write a C++ maze-solving program which ultimately implements
two basic modes:
help a human solve the maze;
automatically solve the maze.
What are the prerequisites for the maze lab?
Students must know how to utilize classes, although they
don't have to know how to create classes. They need to know the selection
structure ("if"), and they need to be able to create a simple loop.
How is the work allocated in the maze lab?
The instructor supplies the maze
class, whose constructor function generates a random maze and displays
it. (The main difference between this maze class interface and the
one printed in the proceedings is that we have de-emphasized the maze walls;
the benefit in manipulating the walls seemed to be outweighed by the complexity.)
The maze display utilizes the RowanGraphics package, currently in the midst
of upgrading (to use DirectX as its foundation). The maze class includes
a move member function. The student gets input from the human maze
solver and is responsible for display of the current position and the trail.
The several different ways of displaying the trail (including erasing it
as you backtrack) keep this from being a trivial problem. And the
automatic solution of the maze is relatively challenging. The end
result looks moderately impressive to the friends or family of the student.
What reactions did the students express about the maze lab?
Here are some samples (from an anonymous questionnaire):
"Although it was very difficult, it was a fun and interesting
approach to programming."
"Graphics are much more fun but harder."
"I enjoyed it very much. I lost track of time."
"I thought it was neat. It made me more productive."
"It was simplified enough to be easy for beginners yet still
fun. Graphics are much better than text."
What philosophy underlies this lab?
Conceptual assistance: teaching objects with real objects.
Motivation: providing the student with something to play
with later or show (or give) to friends, family.
What future use might be made of the maze?
The students can be asked to do further variations on the
maze theme, getting input from a joystick or MIPPET, or randomly generating
moves and gathering statistics about how long it takes to solve a maze
this way. Furthermore, the maze can be discussed in a CS2 class;
for our maze generator (and many others) the maze cells and passages constitute
a tree.
How can you access information about the maze lab or similar labs?
Periodically check the "parent" URL (http://www.rowan.edu/mars/compsci/CS1labs/CS1labs.htm)
for updates or additions. Further, after the upgrade to our RowanGraphics
package has been completed, we plan to submit the maze lab and similar
ones to the WWW-based Computer Science Teaching Center, a repository maintained
at The College of New Jersey (http://www.tcnj.edu/~cstc).
Acknowledgements:
NSF support from grants DUE 97-52626, DUE 98-50983;
maze generator programmed by Redmond English;
MIPPET hardware design assistance from students Chris Bobcowski,
Samuel Greenfeld, and Pat Sherlock;
programming assistance from students Sabina Sokolovic, Ken
Yip, John Halpin, Brian Smith, and Zimmy Shah.