Principle

Submitted by: Submitted by

Views: 211

Words: 509

Pages: 3

Category: Business and Industry

Date Submitted: 04/27/2014 12:44 AM

Report This Essay

FEDERATION UNIVERSITY SCHOOL OF SITE ITECH 7603 ADVANCED PROGRAMMNG SEMESTER 1, 2014 ASSIGNMENT 1. CONWAY'S GAME OF LIFE ON TORUS 20 MARKS

!

0. Introduction. In this assignment you are required to develop a C++ program to run Conway’s Game of Life on a finite board.! Here are the definitions (from Wikipedia):! 0.1. The Classical Game of Life! The Game of Life was invented by British mathematician John Horton Conway in 1970.! The universe of the Classical Game of Life is an infinite two-dimensional grid of square cells, each of which is in one of two possible states, alive or dead (1 or 0). Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:! ! 1.! Any live cell with fewer than two live neighbours dies, as if caused by under-population.! ! 2.! Any live cell with two or three live neighbours lives on to the next generation.! ! 3.! Any live cell with more than three live neighbours dies, as if by overcrowding.! ! 4.! Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.!

!

The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed — births and deaths occur simultaneously. The rules continue to be applied repeatedly to create further generations.! Below are two examples of interesting initial patterns:!

!

Fig 1.Glider Gun!

! ! ! ! !

Fig 2. Pulsar!

0.2. The Game of Life on Torus(GLT).! In the assignment you are required to develop a C++ program for the Game of Life restricted to a finite board (n ✕ n). ! It is the same as the classical game of life except that we assume that the left border of the board is glued to the right border, and the top border of the board is glued to the bottom border. So, there are no borders and the game is played on a torus. See the details in the next...