Lab 12: Instructor's Notes
As a fun way to explore two-dimensional vectors,
this exercise builds a class that facilitates playing
John Conway's cellular automata "game of Life."
The game involves processing a grid of cells,
which we represent as a two-dimensional vector
of vector of integers.
To facilitate this exercise, we provide several files:
-
life.cpp,
a driver program to play the game;
-
LifeGame.h,
the header file for class LifeGame,
which students will complete;
-
LifeGame.cpp,
the implementation file for class LifeGame,
which students will complete;
-
LifeGame.doc,
the documentation file for class LifeGame,
which students will complete;
and
-
Makefile,
to coordinate the translation.
The LifeGame class constructor initializes itself with
a configuration stored in an input file.
To facilitate exploring the game, we also provide several
different configuration files, including
test.life,
stable.life,
quick.life,
cross1.life,
cross2.life,
glider.life,
gliders.life, and
blank.life.
As usual, if you wish to avoid network contention, save local copies
of these files ahead of time and direct your students to access
those local copies.
Back to This Lab's Home Page
Forward to the Prelab Questions
Copyright 1998 by
Joel C. Adams. All rights reserved.