Problem 55 - ECOR1606 Problem Solving and Computers Page 1 of 4 Assignment 8 Game of Life This problem is taken from question 9 page 255 in Cannon

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ECOR1606 Problem Solving and Computers Page 1 of 4 Department of Systems and Computer Engineering, Carleton University Summer 2003 Assignment 8 – Game of Life This problem is taken from question 9, page 255 in Cannon S, Understanding programming – An introduction using C++ , 2 nd Edition, Brooks/Cole, Pacific Grove CA, 2001. The game of life is simulation that models simple primitive interactions such as bacteria. The model uses a two-dimensional matrix and defines neighbor cells as the eight cells that are horizontal, vertically, and diagonally adjacent to a particular cell. The matrix we will use will be type int , with a 0 indicating no life and a 1 to indicate life for a particular entry in the matrix. The model iteratively processes updating the two-dimensional matrix using the following rules. If a cell contains life (i.e. has a 1 entry) but has few than two neighbors, it will die from isolation (i.e. will be updated to a 0 entry). If a cell contains life (i.e. has a 1 entry) but has more than three neighbors, it will die from overpopulation (i.e. will be updated to a 0 entry). If a cell does not contain life (i.e. has a 0 entry) but has exactly three neighbors, life will be born there (i.e. will be updated to a 1 entry). You will be writing a program that performs this simulation. A framework has already been provided. The main function first calls and initArray , which initializes the matrix from a given file. The program then loops until a user inputs a ’q’ . During each loop the matrix is displayed an updated. Your job is to implement the function
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/27/2010 for the course ENG ECOR taught by Professor N/a during the Spring '10 term at Carleton CA.

Page1 / 4

Problem 55 - ECOR1606 Problem Solving and Computers Page 1 of 4 Assignment 8 Game of Life This problem is taken from question 9 page 255 in Cannon

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online