course.wilkes.edu/CS125Labs
Welcome to the site for CS 125 labs!

 

life.cpp

Prev | Next | Lab 12

// life.cpp plays the game of Life.
// Author: Joel Adams, for Hands On C++.
// Date: November 1997.
// Completed by: 
//

#include "LifeGame.h"

int main() { cout << endl << "Enter the name of the initial configuration file: "; string inFile; cin >> inFile;

// initialize the game // LifeGame theGame(inFile);

// clean out the newline following the name of the file char ch; cin.get(ch);

int count = 0; for(;;) { // display current configuration cout // << theGame << endl << "Generation " << count << " - press 'Enter' to continue (Ctrl-D to quit)..." << endl; cin.get(ch);

if (cin.eof()) break;

// generate next configuration // theGame.NextGeneration(); count++; } }

Prev | Next | Lab 12

 
  Home

Help

Lab 0

Lab 1

Lab 2

Lab 3a

Lab 3b

Lab 4

Lab 5

Lab 6

Lab 7

Lab 8

Lab 9

Lab 10

Lab 11

Lab 12

Lab 13



Membership

Login




Last update: Thursday, November 30, 2000 at 12:14:31 PM.
visitors to this page.