Applying The WYSIWYG Model To Life...
•program
Life;
•config
var n : integer = 512;
•region R = [1..n, 1..n];
• BigR = [0..n+1,0..n+1];
•direction N = [-1, 0]; NE = [-1, 1];
• E = [ 0, 1]; SE = [ 1, 1];
• S = [ 1, 0]; SW = [ 1,-1];
• W = [ 0,-1]; NW = [-1,-1];
•var Ncount : [R] byte; TW : [BigR]
boolean;
•procedure
Life();
• [R] begin
• TW := (Index1 * Index2) % 2; --
Make some data
• repeat
• Ncount := (TW@N + TW@NE + TW@E +
TW@SE
• + TW@S + TW@SW + TW@W +
TW@NW);
• TW := (Ncount=2 & TW) |
(Ncount=3 & !TW);
• until false;
• end;
•end;