CS 112b
Spring 2001
Ileana Streinu
Homework 3
Thursday Feb. 15, 2001
Due Wednesday 2/21/2001 by midnight.
Outline
Your task is to write in C++ a program for the game of Life. The program
should be named life.cpp. All the functions and the main program should
be in this file, you shouldn't use other files. You will submit in Hw3
two files, life.cpp and a typescript.
Program
The game of Life, and a structured approach for writing a program for it,
is contained in the handout distributed in class on Th., Feb. 15. The
description in the handout is both in pseudo-code and C. Using it to
guide your thinking, you will have to develop a full C++ program. You should
generously use functions, as suggested by the approach in the handout.
You should use the work you did in the lab,
lecture 6 and
build upon it (i.e. you could and should use
for the homework some of the functions developed
during the lab).
Test your program on the data sets in Fig. 1.1 of the handout, and make sure
these tests show up on your typescript in the same order.
I will make the data sets available to you by the end of the day
today (Th Feb 15).
Summary
- Submit two files named life.cpp and typescript
in Hw3.
- The program should be tested on all of these
data files.
- The typescript should show the
compilation and testing on all the data files, and should be clean, readable,
and un-edited (it will be compared with what the TAs script will
generate by running the program through the data file).
Ileana Streinu