Conway's Game of Life


#1

Hi there! - This is my game of life’s implementation on SciDB.

To start with a 2D 10x10 random array of 0 and 1s

store(build(<val:double NULL DEFAULT null>[i=0:9,9,0,j=0:9,9,0],random()%2), COMWAY);

An to move the board one step forward:

insert(project(apply(apply(apply(join(COMWAY, window(COMWAY, 1, 1, 1, 1, sum(val))), sum, val_sum - val),factor,iif((val = 0 and sum != 3), 0,iif((val = 0 and sum = 3), 1,iif(sum < 2, -1,iif(sum > 3,-1,0))))    ),newval, double(val + factor)), newval), COMWAY);

Any step can be recovered using the respective array versions, for example

scan(COMWAY@5)

So, it seems SciDB could be used as a cellular automata platform.

Kind regards


#2

Indeed!


#3

Cool!