The challenge is to find the shortest implementation of the game of life in 3D (example). These are the rules:
Cells (in this case, cubes) with only 1 or less neighbours die, as if by lonliness.
If exactly 5 cells surround an empty cell, they breed and fill it.
If a cell has 8 or more neighbours, it dies from overcrowding.
Make it at least a 10x10x10, where the layers are outputted individually like this:
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 X 0 0 X 0 0 0 0 0
0 0 X X X 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Of course, a graphic 3D simulation is also accepted
The starting position may be hardcoded but it must work if it is changed to any starting position. It must be able to calculate any amount of generations, and the user must be able to manually ask for the next generation.
Shortest code in characters wins!
I made my own implementation of this for any (cube) size: http://jensrenders.site88.net/life3D.htm You can use this to test, and you can base your code on mine, although I didn't comment it.