You are on page 1of 2

th

11
11th Marathon
Marathon of
of Parallel
Parallel Programming
Programming WSCAD
WSCAD 2016
2016 77

Problem B
Game of Life
The
The Game
Game of of Life
Life is
is aa cellular
cellular automaton
automaton invented
invented byby Cambridge
Cambridge mathematician
mathematician John
John
Conway.
Conway. ItIt consists
consists of
of aa collection
collection of
of cells
cells which,
which, based
based on
on aa few
few mathematical
mathematical rules,
rules,
can
can live,
live, die
die or
or multiply.
multiply. Depending
Depending onon the
the initial
initial conditions,
conditions, the
the cells
cells form
form various
various
patterns
patterns throughout
throughout the
the course
course of
of the
the game.
game. In
In this
this version
version of
of the
the game
game we
we have
have aa square
square
board (2D array) where cells are updated in each timestep according to the following
board (2D array) where cells are updated in each timestep according to the following
rules:
rules:
For
For aa space
space that
that is
is populated:
populated:
o Each cell with one
o Each cell with one or
or no
no neighbors
neighbors dies,
dies, as
as if
if by
by solitude.
solitude.
o Each
o Each cell
cell with
with four
four or
or more
more neighbors
neighbors dies,
dies, as
as if
if by
by overpopulation.
overpopulation.
o Each
o Each cell
cell with
with two
two or
or three
three neighbors
neighbors survives.
survives.

For
For aa space
space that
that is
is empty
empty or
or unpopulated:
unpopulated:

o Each
o Each cell
cell with
with three
three neighbors
neighbors becomes
becomes populated.
populated.

Figure
Figure B1
B1 provides
provides an
an example
example of
of the
the Game
Game ofof Life
Life in
in aa 1111
1111 board.
board. Empty
Empty cells
cells and
and
populated
populated cells
cells are
are represented
represented by
by light
light and
and dark
dark gray
gray squares,
squares, respectively.
respectively. Pane
Pane (a)
(a)
shows
shows the
the initial
initial board
board and
and pane
pane (h)
(h) shows
shows the
the simulation
simulation result
result after
after 77 timesteps.
timesteps.

(a)
(a) initial
initial board
board (b)
(b) step
step 11 (c)
(c) step
step 22 (d)
(d) step
step 33

(e)
(e) step
step 44 (f)
(f) step
step 55 (g)
(g) step
step 66 (h)
(h) step
step 77
Figure
Figure B1.
B1. Game
Game of
of Life
Life example.
example. 7-step
7-step simulation
simulation on
on aa 11
11
11
11 board.
board.

You might also like