Connecting Tech Pros Worldwide Forums | Help | Site Map

Game of Life

Newbie
 
Join Date: Oct 2009
Posts: 1
#1: 4 Weeks Ago
The Game of Life (most of you would be familiar with) consists of a two- dimensional plane of cells. each cell may be empty or contain a single creature. Each day, creatures are born or die according to the number of cells neighbouring them (any cell around them is a neighbour).

(Please read this)
if the number of alive neighbours is 2 or 3 then the cell lives, otherwise it dies.
if the number of alive neighbours is exactly 3 then the cell becomes alive. (if its 2or 4 then it wont become alive).
0s represents the cells in the world.
Xs represent cells alive.

example of the world -
0000000000
0000000000
000XXX0000
0000000000
0000000000
0000000000

next day -
0000000000
0000X00000
0000X00000
0000X00000
0000000000
0000000000


make a 20x20 grid. to initialize , prompt user for coordinates of live cells. application should generate each day's world as long as the wishes to continue or until there are no more live cells.
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: 4 Weeks Ago

re: Game of Life


Please read the posting guidelines. We are not a homework service.
Reply

Tags
application, game of life, java