I posted this last night as a update instead of a forum post so here it is again.
GAME OF LIFE:
http://www.bitstorm.org/gameoflife/
I am trying to recreate a slimmed down version of GAME of LIFE with SCRIPT BLOCKS
So the Block looks NORTH , SOUTH, EAST AND WEST for neighbors.
NESW DEAD/SURVIVE
0000 D
0001 D
0010 D
0011 S
0100 D
0101 S
0110 S
0111 S
1000 D
1001 S
1010 S
1011 S
1100 S
1101 S
1110 S
1111 D
I Determined that only 3 different states need to destroy the block. ONESIDEONLY, ALLSIDES, NOSIDES. HERE ARE MY ATTEMPTS
Logic Gate to handle ONLYONESIDE . 3 XOR gates
Logic Gate to Handle ALLSIDES. 3 AND Gates
interesting… are you handling birth of a cell under survive on purpose?
Birth of a cell to my knowledge is when there is a empty Cell surrounded by 3 or more occupied Cells.
I will need to do this in my Level script instead of in the Blocks themselves.
to my knowledge birth occurs only with a dead cell having exactly 3 neighbours
I was studying this algorithm too last year, trying to have a grasp of living but controllable environment
And the only difference between a dead cell and an empty cell is terminology… so it looks to me like you guys just said the same thing.
yeah that’s the same, I just said “exactly 3 neighbours” vs. “3 or more occupied Cells”
Ah, of course. Reading for clarity. Sorry.
Yes, exactly three is the way I’ve done it too.
Have you seen WireWorld ? Very similar to Conways Game of Life, I got a massive nerd boner over this about 10 years ago after I saw some nut cases made a working clock out of it… couldn’t find the clock but here is a computer that calculates primes made from it :
The animated working version is pretty impresive.
… I will give you half a bit coin if you can replicate that in Script Blocks
@thetoucher I never heard of that game but looks crazy.
here is my attempt to put all three tests together into one tower.
I combined all 3 GOF Machines into one. But I realized that the ONLYONESIDE Part is not working.
Something is wrong with my logic on the first “floor” For the case where it is testing for
0001
0010
0100
1000
I used three xor gates where AB goes into XOR(1) CD goes into XOR(2) and XOR(1) XOR(2) goes into XOR(3)
but that fails for the cases such as A=1 B=1 and C=1
still lots O fun though.
I uploaded the alpha 12 last night with a level called levelGOL.js
It has the toad pattern .
I added the pulsar pattern
http://www.youtube.com/watch?v=e9hyceWOrR0
get the game at
scriptblocks.com
[java]application.pulsar = function() {
var row = rowSize / 2;
var col = rowSize / 2;
// Top Right
application.setValue(row, col - 1, true);
application.setValue(row, col, true);
application.setValue(row, col + 1, true);
application.setValue(row - 1, col - 2, true);
application.setValue(row - 2, col - 2, true);
application.setValue(row - 3, col - 2, true);
application.setValue(row - 5, col - 1, true);
application.setValue(row - 5, col, true);
application.setValue(row - 5, col + 1, true);
application.setValue(row - 1, col + 3, true);
application.setValue(row - 2, col + 3, true);
application.setValue(row - 3, col + 3, true);
// Bottom Right
application.setValue(row + 2, col - 1, true);
application.setValue(row + 2, col, true);
application.setValue(row + 2, col + 1, true);
application.setValue(row + 3, col - 2, true);
application.setValue(row + 4, col - 2, true);
application.setValue(row + 5, col - 2, true);
application.setValue(row + 7, col - 1, true);
application.setValue(row + 7, col, true);
application.setValue(row + 7, col + 1, true);
application.setValue(row + 3, col + 3, true);
application.setValue(row + 4, col + 3, true);
application.setValue(row + 5, col + 3, true);
// Top Left
application.setValue(row, col - 7, true);
application.setValue(row, col - 6, true);
application.setValue(row, col - 5, true);
application.setValue(row - 1, col - 4, true);
application.setValue(row - 2, col - 4, true);
application.setValue(row - 3, col - 4, true);
application.setValue(row - 5, col - 7, true);
application.setValue(row - 5, col - 6, true);
application.setValue(row - 5, col - 5, true);
application.setValue(row - 1, col - 9, true);
application.setValue(row - 2, col - 9, true);
application.setValue(row - 3, col - 9, true);
// Bottom Left
application.setValue(row + 2, col - 7, true);
application.setValue(row + 2, col - 6, true);
application.setValue(row + 2, col - 5, true);
application.setValue(row + 3, col - 4, true);
application.setValue(row + 4, col - 4, true);
application.setValue(row + 5, col - 4, true);
application.setValue(row + 7, col - 7, true);
application.setValue(row + 7, col - 6, true);
application.setValue(row + 7, col - 5, true);
application.setValue(row + 3, col - 9, true);
application.setValue(row + 4, col - 9, true);
application.setValue(row + 5, col - 9, true);
}
[/java]