wdgt 6 H 3 < ;9 ot Ot t
off
0
0
main
DarkNet FireFly Game
596
502
true
255
0
0
playbutton
toggleStatus(1)
toggleClickable()
toggleClickable()
darkNetbutton
openURL('http://the-dark-net.blogspot.com/2007/05/darknet-firefly-toy.html')
toggleClickable()
toggleClickable()
hiddenMessageButton
showStartPattern(cellsrc)
toggleClickable()
toggleClickable()
NoiseUpbutton
NoiseUp()
toggleClickable()
toggleClickable()
NoiseDownbutton
NoiseDown()
toggleClickable()
toggleClickable()
speedUpbutton
speedUpCycle()
toggleClickable()
toggleClickable()
speedDownbutton
speedDownCycle()
toggleClickable()
toggleClickable()
couplingUpbutton
couplingUp()
toggleClickable()
toggleClickable()
couplingDownbutton
couplingDown()
toggleClickable()
toggleClickable()
stopbutton
toggleStatus(0)
toggleClickable()
toggleClickable()
clearbutton
clearBoard(rows, columns)
toggleClickable()
toggleClickable()
randombutton
randomizeBoard(rows, columns)
toggleClickable()
toggleClickable()
synchbutton
synchBoard(rows, columns)
toggleClickable()
toggleClickable()
resetbutton
resetBoard(rows, columns)
toggleClickable()
toggleClickable()
gencounter
0
245
10
10
10
right
gencounterlabel
Generations:
140
10
10
10
cyclecounter
20
245
20
10
10
right
cyclecounterlabel
Flash Period:
140
20
10
10
couplingcounter
0
245
30
10
10
right
couplingcounterlabel
Coupling:
140
30
10
10
noiseLevel
0
245
40
10
10
right
noiseLevellabel
Noise:
140
40
10
10
cycle=20;
coupling=0;
noise=0;
//////////////////////////////////////////////////////////////////////
// Change the board configuration to show a sample pattern
//////////////////////////////////////////////////////////////////////
function showStartPattern(cellsrc) {
clearBoard(rows, columns)
board[1][1].liveFlag = 1;
board[2][1].liveFlag = 1;
board[3][1].liveFlag = 1;
board[1][2].liveFlag = 1;
board[3][2].liveFlag = 1;
board[1][3].liveFlag = 1;
board[1][4].liveFlag = 1;
board[1][5].liveFlag = 1;
board[2][3].liveFlag = 1;
board[2][4].liveFlag = 1;
board[3][5].liveFlag = 1;
board[3][3].liveFlag = 1;
board[5][1].liveFlag = 1;
board[5][2].liveFlag = 1;
board[5][3].liveFlag = 1;
board[5][4].liveFlag = 1;
board[5][5].liveFlag = 1;
board[6][1].liveFlag = 1;
board[7][1].liveFlag = 1;
board[6][3].liveFlag = 1;
board[6][5].liveFlag = 1;
board[7][5].liveFlag = 1;
board[9][2].liveFlag = 1;
board[9][3].liveFlag = 1;
board[9][4].liveFlag = 1;
board[9][5].liveFlag = 1;
board[10][1].liveFlag = 1;
board[10][3].liveFlag = 1;
board[11][2].liveFlag = 1;
board[11][3].liveFlag = 1;
board[11][4].liveFlag = 1;
board[11][5].liveFlag = 1;
board[13][1].liveFlag = 1;
board[13][2].liveFlag = 1;
board[13][3].liveFlag = 1;
board[13][4].liveFlag = 1;
board[13][5].liveFlag = 1;
board[14][1].liveFlag = 1;
board[14][5].liveFlag = 1;
board[15][2].liveFlag = 1;
board[15][3].liveFlag = 1;
board[15][4].liveFlag = 1;
board[1][7].liveFlag = 1;
board[2][7].liveFlag = 1;
board[2][8].liveFlag = 1;
board[2][9].liveFlag = 1;
board[2][10].liveFlag = 1;
board[2][11].liveFlag = 1;
board[3][7].liveFlag = 1;
board[5][7].liveFlag = 1;
board[5][8].liveFlag = 1;
board[5][9].liveFlag = 1;
board[5][10].liveFlag = 1;
board[5][11].liveFlag = 1;
board[6][9].liveFlag = 1;
board[7][7].liveFlag = 1;
board[7][8].liveFlag = 1;
board[7][9].liveFlag = 1;
board[7][10].liveFlag = 1;
board[7][11].liveFlag = 1;
board[9][7].liveFlag = 1;
board[9][8].liveFlag = 1;
board[9][9].liveFlag = 1;
board[9][10].liveFlag = 1;
board[9][11].liveFlag = 1;
board[10][7].liveFlag = 1;
board[10][9].liveFlag = 1;
board[10][11].liveFlag = 1;
board[11][7].liveFlag = 1;
board[11][11].liveFlag = 1;
board[1][13].liveFlag = 1;
board[1][14].liveFlag = 1;
board[1][15].liveFlag = 1;
board[1][16].liveFlag = 1;
board[1][17].liveFlag = 1;
board[2][13].liveFlag = 1;
board[2][17].liveFlag = 1;
board[3][14].liveFlag = 1;
board[3][15].liveFlag = 1;
board[3][16].liveFlag = 1;
board[5][14].liveFlag = 1;
board[5][15].liveFlag = 1;
board[5][16].liveFlag = 1;
board[5][17].liveFlag = 1;
board[6][13].liveFlag = 1;
board[6][15].liveFlag = 1;
board[7][14].liveFlag = 1;
board[7][15].liveFlag = 1;
board[7][16].liveFlag = 1;
board[7][17].liveFlag = 1;
board[9][13].liveFlag = 1;
board[9][14].liveFlag = 1;
board[9][15].liveFlag = 1;
board[9][16].liveFlag = 1;
board[9][17].liveFlag = 1;
board[10][13].liveFlag = 1;
board[10][15].liveFlag = 1;
board[10][16].liveFlag = 1;
board[11][13].liveFlag = 1;
board[11][14].liveFlag = 1;
board[11][15].liveFlag = 1;
board[11][17].liveFlag = 1;
board[13][13].liveFlag = 1;
board[13][14].liveFlag = 1;
board[13][15].liveFlag = 1;
board[13][16].liveFlag = 1;
board[13][17].liveFlag = 1;
board[14][16].liveFlag = 1;
board[15][15].liveFlag = 1;
board[15][17].liveFlag = 1;
board[1][19].liveFlag = 1;
board[1][20].liveFlag = 1;
board[1][21].liveFlag = 1;
board[1][22].liveFlag = 1;
board[1][23].liveFlag = 1;
board[2][19].liveFlag = 1;
board[3][19].liveFlag = 1;
board[3][20].liveFlag = 1;
board[3][21].liveFlag = 1;
board[3][22].liveFlag = 1;
board[3][23].liveFlag = 1;
board[5][19].liveFlag = 1;
board[5][20].liveFlag = 1;
board[5][21].liveFlag = 1;
board[5][22].liveFlag = 1;
board[5][23].liveFlag = 1;
board[6][19].liveFlag = 1;
board[6][21].liveFlag = 1;
board[6][23].liveFlag = 1;
board[7][19].liveFlag = 1;
board[7][23].liveFlag = 1;
board[9][19].liveFlag = 1;
board[10][19].liveFlag = 1;
board[10][20].liveFlag = 1;
board[10][21].liveFlag = 1;
board[10][22].liveFlag = 1;
board[10][23].liveFlag = 1;
board[11][19].liveFlag = 1;
cellcounter += 34;
}
//////////////////////////////////////////////////////////////////////
// generate a random scattering of cells on the board
//////////////////////////////////////////////////////////////////////
function randomizeBoard(rows, columns) {
var rand;
var i = rows;
while (i--) {
var j = columns;
while (j--) {
if (board[i][j].liveFlag==1)
{
board[i][j].flashTime = Math.floor(Math.random()*cycle+1);
if (board[i][j].flashTime == cycle)
{
board[i][j].src = cellsrc;
cellcounter++;
}
else
{
board[i][j].src = cellSleepsrc;
}
}
}
}
generationCounter = 1;
gencounter.data = generationCounter + '';
playbutton.src = "Resources/play.png";
hiddenMessageButton.src = "Resources/hiddenMessageButton.png";
speedUpbutton.src = "Resources/speedUp.png";
speedDownbutton.src = "Resources/speedDown.png";
NoiseUpbutton.src = "Resources/speedUp.png";
NoiseDownbutton.src = "Resources/speedDown.png";
stopbutton.src = "Resources/stop.png";
randombutton.src = "Resources/random.png";
clearbutton.src = "Resources/clear.png";
}
//////////////////////////////////////////////////////////////////////
// synchronize the live cells
//////////////////////////////////////////////////////////////////////
function synchBoard(rows, columns) {
var rand;
var i = rows;
while (i--) {
var j = columns;
while (j--) {
if (board[i][j].liveFlag==1)
{
board[i][j].flashTime = cycle;
board[i][j].src = cellsrc;
}
}
}
generationCounter = 1;
gencounter.data = generationCounter + '';
playbutton.src = "Resources/play.png";
hiddenMessageButton.src = "Resources/hiddenMessageButton.png";
speedUpbutton.src = "Resources/speedUp.png";
speedDownbutton.src = "Resources/speedDown.png";
NoiseUpbutton.src = "Resources/speedUp.png";
NoiseDownbutton.src = "Resources/speedDown.png";
stopbutton.src = "Resources/stop.png";
randombutton.src = "Resources/random.png";
synchbutton.src = "Resources/synch.png";
clearbutton.src = "Resources/clear.png";
}
//////////////////////////////////////////////////////////////////////
// reset all cells to live
//////////////////////////////////////////////////////////////////////
function resetBoard(rows, columns) {
cellcounter=0;
var i = rows;
while (i--)
{
var j = columns;
while (j--) {
board[i][j].liveFlag=1;
board[i][j].flashTime = cycle;
board[i][j].src = cellsrc;
cellcounter++
}
}
generationCounter = 1;
gencounter.data = generationCounter + '';
playbutton.src = "Resources/play.png";
hiddenMessageButton.src = "Resources/hiddenMessageButton.png";
speedUpbutton.src = "Resources/speedUp.png";
speedDownbutton.src = "Resources/speedDown.png";
NoiseUpbutton.src = "Resources/speedUp.png";
NoiseDownbutton.src = "Resources/speedDown.png";
stopbutton.src = "Resources/stop.png";
randombutton.src = "Resources/random.png";
synchbutton.src = "Resources/synch.png";
resetbutton.src = "Resources/reset.png";
clearbutton.src = "Resources/clear.png";
}
//////////////////////////////////////////////////////////////////////
// clear the board
//////////////////////////////////////////////////////////////////////
function clearBoard(rows, columns) {
var i = rows;
while (i--) {
var j = columns;
while (j--) {
board[i][j].src = emptysrc;
board[i][j].liveFlag=0;
}
}
cellcounter = 0;
generationCounter = 1;
gencounter.data = generationCounter + '';
playbutton.src = "Resources/play.png";
hiddenMessageButton.src = "Resources/hiddenMessageButton.png";
speedUpbutton.src = "Resources/speedUp.png";
speedDownbutton.src = "Resources/speedDown.png";
NoiseUpbutton.src = "Resources/speedUp.png";
NoiseDownbutton.src = "Resources/speedDown.png";
couplingUpbutton.src = "Resources/couplingUp.png";
couplingDownbutton.src = "Resources/couplingDown.png";
stopbutton.src = "Resources/stop.png";
randombutton.src = "Resources/random.png";
synchbutton.src = "Resources/synch.png";
resetbutton.src = "Resources/reset.png";
clearbutton.src = "Resources/clear.png";
}
//////////////////////////////////////////////////////////////////////
// Switch an empty square to a cell, or vice versa
//////////////////////////////////////////////////////////////////////
function switchImage(x, y) {
var thiscell = board[x][y];
if (thiscell.liveFlag == 1) {
thiscell.src = offsrc;
thiscell.flashTime = 1;
cellcounter--;
thiscell.liveFlag=0;
}
else {
thiscell.src = cellsrc;
thiscell.flashTime = cycle;
cellcounter++;
thiscell.liveFlag=1;
}
}
//////////////////////////////////////////////////////////////////////
// Set a flag determining whether or not the pointer is over a button
//////////////////////////////////////////////////////////////////////
function toggleClickable() {
if (clickable == 1) {
clickable = 0;
}
else {
clickable = 1;
}
// print("clickable set to the value " + clickable);
}
//////////////////////////////////////////////////////////////////////
// Start or stop
//////////////////////////////////////////////////////////////////////
function toggleStatus(action) {
if (action == 0) {
status = 0;
playbutton.src = "Resources/play.png";
hiddenMessageButton.src = "Resources/hiddenMessageButton.png";
speedUpbutton.src = "Resources/speedUp.png";
speedDownbutton.src = "Resources/speedDown.png";
NoiseUpbutton.src = "Resources/speedUp.png";
NoiseDownbutton.src = "Resources/speedDown.png";
couplingUpbutton.src = "Resources/couplingUp.png";
couplingDownbutton.src = "Resources/couplingDown.png";
stopbutton.src = "Resources/stop_on.png";
randombutton.src = "Resources/random.png";
synchbutton.src = "Resources/synch.png";
resetbutton.src = "Resources/reset.png";
clearbutton.src = "Resources/clear.png";
// print("Stopped! (" + status + ")");
}
else {
status = 1;
playbutton.src = "Resources/play_on.png";
hiddenMessageButton.src = "Resources/hiddenMessageButton.png";
speedUpbutton.src = "Resources/speedUp.png";
speedDownbutton.src = "Resources/speedDown.png";
NoiseUpbutton.src = "Resources/speedUp.png";
NoiseDownbutton.src = "Resources/speedDown.png";
couplingUpbutton.src = "Resources/couplingUp.png";
couplingDownbutton.src = "Resources/couplingDown.png";
stopbutton.src = "Resources/stop.png";
randombutton.src = "Resources/random.png";
synchbutton.src = "Resources/synch.png";
resetbutton.src = "Resources/reset.png";
clearbutton.src = "Resources/clear.png";
// print("Starting! (" + status + ")");
}
}
//////////////////////////////////////////////////////////////////////
// Speed Up
//////////////////////////////////////////////////////////////////////
function speedUpCycle()
{
cycle++;
}
//////////////////////////////////////////////////////////////////////
// Speed Down
//////////////////////////////////////////////////////////////////////
function speedDownCycle()
{
if (cycle > 0)
{
cycle=cycle-1;
}
}
//////////////////////////////////////////////////////////////////////
// Noise Up
//////////////////////////////////////////////////////////////////////
function NoiseUp()
{
noise++;
}
//////////////////////////////////////////////////////////////////////
// Speed Down
//////////////////////////////////////////////////////////////////////
function NoiseDown()
{
if (noise > 0)
{
noise=noise-1;
}
}
//////////////////////////////////////////////////////////////////////
// Coupling Up
//////////////////////////////////////////////////////////////////////
function couplingUp()
{
coupling++;
}
//////////////////////////////////////////////////////////////////////
// Coupling Down
//////////////////////////////////////////////////////////////////////
function couplingDown()
{
//if (coupling > 0)
//{
coupling=coupling-1;
//}
}
//////////////////////////////////////////////////////////////////////
// Determine whether a given cell is born, survives, or dies
//////////////////////////////////////////////////////////////////////
function determineNeighbors(x, y, cellsrc, emptysrc)
{
var neighbors = 0;
var i = -1;
while (i < 2) {
var j = -1;
while (j < 2) {
var xcoord = x + i;
var ycoord = y + j;
if ((xcoord == x) && (ycoord == y)) {
//same cell, so do nothing
}
else {
if (xcoord < 0) {
xcoord += columns;
}
else {
if (xcoord > (columns - 1)) {
xcoord -= columns;
}
}
if (ycoord < 0) {
ycoord += rows;
}
else {
if (ycoord > (rows - 1)) {
ycoord -= rows;
}
}
if (board[xcoord][ycoord].src == cellsrc) {
neighbors++;
}
}
j++;
}
i++;
}
return neighbors;
}
///////////////////////////////////////////////
// New Version: Iterate through generations
//////////////////////////////////////////////////////////////////////
function runGenerations2(cellsrc, emptysrc)
{
var i = rows;
var j, neighbors;
while (i--)
{
var j = columns;
while (j--)
{
if (board[i][j].liveFlag==1)
{
board[i][j].flashTime= board[i][j].flashTime+1+ ( (Math.floor(Math.random()*(noise+1)+1)-1));
}
}
}
i = rows;
while (i--)
{
var j = columns;
while (j--)
{
if (board[i][j].liveFlag==1)
{
backstage[i][j] = determineNeighbors(i, j, cellsrc, emptysrc);
}
}
}
var i = rows;
while (i--)
{
j = columns;
while (j--)
{
if (board[i][j].liveFlag==1)
{
if (board[i][j].flashTime == cycle)
{
board[i][j].src = cellsrc;
board[i][j].flashTime=0;
}
else
{
if (board[i][j].flashTime < 0)
{
board[i][j].flashTime = 0;
}
else
{
if (board[i][j].flashTime < cycle)
{
board[i][j].flashTime = board[i][j].flashTime+ (coupling*backstage[i][j]);
board[i][j].src = cellSleepsrc;
}
else
{
board[i][j].src = cellsrc;
board[i][j].flashTime=1;
}
}
}
}
}
}
updateNow();
}
//////////////////////////////////////////////////////////////////////
// Main body
//////////////////////////////////////////////////////////////////////
var generationCounter = 1;
var cycle;
var coupling;
var noise;
//////////////////////////////////////////////////////////////////////
// Cell, row, and column sizes
//////////////////////////////////////////////////////////////////////
var cellheight = 10;
var cellwidth = 10;
var rows = 25;
var columns = 25;
//////////////////////////////////////////////////////////////////////
// Board variables
//////////////////////////////////////////////////////////////////////
var hCoordOffset = 1;
var vCoordOffset = 42;
var board = new Array(rows);
var backstage = new Array(rows);
//////////////////////////////////////////////////////////////////////
// Image sizes
//////////////////////////////////////////////////////////////////////
var titlebarHeight = vCoordOffset;
var borderWidth = 1;
var bottombarHeight = 24;
var cellsrc = "Resources/cell.png";
var cellSleepsrc = "Resources/cellSleep.png";
var emptysrc = "Resources/empty.png";
var offsrc = "Resources/off.png";
//////////////////////////////////////////////////////////////////////
// Assorted control variables
//////////////////////////////////////////////////////////////////////
var status = 0;
var cellcounter = 0;
var clickable = 0;
//////////////////////////////////////////////////////////////////////
// More images, and more parameters for previously-defined images.
//
// Opacities set to 0 so that these images load at the same time as the
// board (further down). There's probably a better way to do this.
//////////////////////////////////////////////////////////////////////
var titlebar = new Image();
titlebar.src = "Resources/top.png";
titlebar.hOffset = 28;
titlebar.vOffset = 0;
titlebar.height = titlebarHeight;
titlebar.width = 100;
//(columns * cellwidth) + (2 * borderWidth)+1;
titlebar.opacity = 0;
var leftborder = new Image();
leftborder.src = "Resources/border.png";
leftborder.hOffset = 0;
leftborder.vOffset = titlebarHeight;
leftborder.height = rows * cellheight;
leftborder.width = borderWidth;
leftborder.opacity = 0;
var rightborder = new Image();
rightborder.src = "Resources/border.png";
rightborder.hOffset = (columns * cellwidth) + borderWidth;
rightborder.vOffset = titlebarHeight;
rightborder.height = rows * cellheight;
rightborder.width = borderWidth;
rightborder.opacity = 0;
var bottomleftcorner = new Image();
bottomleftcorner.src = "Resources/bottom_left.png";
bottomleftcorner.hOffset = 0;
bottomleftcorner.vOffset = ((rows * cellheight) + titlebarHeight) +23;
bottomleftcorner.height = bottombarHeight;
bottomleftcorner.width = 1;
bottomleftcorner.opacity = 0;
playbutton.hOffset = 0;
playbutton.vOffset = ((rows * cellheight) + titlebarHeight) - 1;
playbutton.height = bottombarHeight;
playbutton.width = 20;
playbutton.opacity = 0;
stopbutton.hOffset = 20;
stopbutton.vOffset = ((rows * cellheight) + titlebarHeight) - 1;
stopbutton.height = bottombarHeight;
stopbutton.width = 20;
stopbutton.opacity = 0;
resetbutton.hOffset = 40;
resetbutton.vOffset = ((rows * cellheight) + titlebarHeight) -1;
resetbutton.height = bottombarHeight;
resetbutton.width = 45;
resetbutton.opacity = 0;
randombutton.hOffset = 85;
randombutton.vOffset = ((rows * cellheight) + titlebarHeight) - 1;
randombutton.height = bottombarHeight;
randombutton.width = 45;
randombutton.opacity = 0;
synchbutton.hOffset = 130;
synchbutton.vOffset = ((rows * cellheight) + titlebarHeight) - 1;
synchbutton.height = bottombarHeight;
synchbutton.width = 45;
synchbutton.opacity = 0;
clearbutton.hOffset = 175;
clearbutton.vOffset = ((rows * cellheight) + titlebarHeight) - 1;
clearbutton.height = bottombarHeight;
clearbutton.width = 45;
clearbutton.opacity = 0;
hiddenMessageButton.hOffset = 220;
hiddenMessageButton.vOffset = ((rows * cellheight) + titlebarHeight) -1;
hiddenMessageButton.height = bottombarHeight;
hiddenMessageButton.width = 20;
hiddenMessageButton.opacity = 0;
speedDownbutton.hOffset = 1;
speedDownbutton.vOffset = ((rows * cellheight) + titlebarHeight) + 23;
speedDownbutton.height = bottombarHeight;
speedDownbutton.width = 20;
speedDownbutton.opacity = 0;
var flashPeriod = new Image();
flashPeriod.src = "Resources/flashPeriod.png";
flashPeriod.hOffset = 21;
flashPeriod.vOffset = ((rows * cellheight) + titlebarHeight) +23;
flashPeriod.height = bottombarHeight;
flashPeriod.width = 29;
flashPeriod.opacity = 255;
speedUpbutton.hOffset = 50;
speedUpbutton.vOffset = ((rows * cellheight) + titlebarHeight) + 23;
speedUpbutton.height = bottombarHeight;
speedUpbutton.width = 20;
speedUpbutton.opacity = 0;
var Bottom_space = new Image();
Bottom_space.src = "Resources/Bottom_space.png";
Bottom_space.hOffset = 70;
Bottom_space.vOffset = ((rows * cellheight) + titlebarHeight) + 23;
Bottom_space.height = bottombarHeight;
Bottom_space.width = 10;
Bottom_space.opacity = 255;
couplingDownbutton.hOffset = 80;
couplingDownbutton.vOffset = ((rows * cellheight) + titlebarHeight) + 23;
couplingDownbutton.height = bottombarHeight;
couplingDownbutton.width = 20;
couplingDownbutton.opacity = 255;
var couplingLabel = new Image();
couplingLabel.src = "Resources/couplingLabel.png";
couplingLabel.hOffset = 100;
couplingLabel.vOffset = ((rows * cellheight) + titlebarHeight) +23;
couplingLabel.height = bottombarHeight;
couplingLabel.width = 35;
couplingLabel.opacity = 255;
couplingUpbutton.hOffset = 135;
couplingUpbutton.vOffset = ((rows * cellheight) + titlebarHeight) + 23;
couplingUpbutton.height = bottombarHeight;
couplingUpbutton.width = 20;
couplingUpbutton.opacity = 255;
var Bottom_space2 = new Image();
Bottom_space2.src = "Resources/Bottom_space.png";
Bottom_space2.hOffset = 155;
Bottom_space2.vOffset = ((rows * cellheight) + titlebarHeight) + 23;
Bottom_space2.height = bottombarHeight;
Bottom_space2.width = 10;
Bottom_space2.opacity = 255;
NoiseDownbutton.hOffset = 165;
NoiseDownbutton.vOffset = ((rows * cellheight) + titlebarHeight) +23;
NoiseDownbutton.height = bottombarHeight;
NoiseDownbutton.width = 20;
NoiseDownbutton.opacity = 0;
var randomNoise = new Image();
randomNoise.src = "Resources/randomNoise.png";
randomNoise.hOffset = 185;
randomNoise.vOffset = ((rows * cellheight) + titlebarHeight) +23;
randomNoise.height = bottombarHeight;
randomNoise.width = 35;
randomNoise.opacity = 255;
NoiseUpbutton.hOffset = 220;
NoiseUpbutton.vOffset = ((rows * cellheight) + titlebarHeight) +23;
NoiseUpbutton.height = bottombarHeight;
NoiseUpbutton.width = 20;
NoiseUpbutton.opacity = 0;
//////////////////////////////////////////////////////////////////////
// Loop through each position on the board and initialize each cell with a random flashTime number between 0 and cycle.
//////////////////////////////////////////////////////////////////////
var i = rows;
while (i--) {
board[i] = new Array(columns);
backstage[i] = new Array(columns);
var j = columns;
while (j--) {
board[i][j] = new Image();
board[i][j].hOffset = (i * cellwidth) + hCoordOffset;
board[i][j].vOffset = (j * cellheight) + vCoordOffset;
board[i][j].src = emptysrc;
board[i][j].name = i + "." + j + '.cell';
//board[i][j].flashTime=Math.floor(Math.random()*cycle+1);
board[i][j].onMouseUp = "switchImage(" + i + "," + j + ");";
board[i][j].opacity = 255;
}
}
main.visible = true;
titlebar.opacity = 255;
rightborder.opacity = 255;
leftborder.opacity = 255;
bottomleftcorner.opacity = 255;
playbutton.opacity = 255;
speedUpbutton.opacity=255;
NoiseUpbutton.opacity=255;
NoiseDownbutton.opacity=255;
hiddenMessageButton.opacity=255;
speedDownbutton.opacity=255;
couplingUpbutton.opacity=255;
couplingDownbutton.opacity=255;
stopbutton.opacity = 255;
randombutton.opacity = 255;
synchbutton.opacity = 255;
resetbutton.opacity = 255;
clearbutton.opacity = 255;
//bottomrightcorner.opacity = 255;
//showStartPattern(cellsrc);
//clearBoard(rows, columns);
resetBoard(rows, columns)
randomizeBoard(rows, columns);
status=1;
if (status == 1) {
if (cellcounter > 0) {
runGenerations2(cellsrc, emptysrc);
generationCounter++;
gencounter.data = generationCounter;
cyclecounter.data = cycle;
couplingcounter.data = coupling;
noiseLevel.data=noise;
}
else {
toggleStatus();
}
}
Resources/about.png
^ ] H GIF89a,, 999筥cZZ{{ƭ911sccֵcRRsskk)!!RBB{{J99kRR9))J111!) ƥֽkc{ZB9Z {s{k{kcZJBƽ{c)sc) s{cR9!sRR)J! k1 Ƶ1)!ƜsZ)s9 ƽ{B kBRZ{Rc9 R Z c1k!cBZkZ c ZkssR R{cBƄc{c k s { sR!c{1sZ!ƌޜ֜ޥΔƌ Δ ֜ 1) ƭֵΥƜޭޥΔkƄkkքkJsZRkJBZZ9BB9)1)Z BBB眭9Z)JƌZsRk1s{!9{֭省9JZ{Zc19)1!) kckBJ19!!kR9 ! ) 1 R k { {ZJRJ)R!J9Bcs{ks , ,,@ H*\x0@IHŋ3jȱ?X CIɓ(S\ɲɁcIs͚8osp"zJю.*]ʴ҆>{JJujBGjѩׯ`þt!DqdɂmUd(P(W&J%! G"DÇ#D(a]+')yeQڜَ;o5+NCr=#'ζƕ3z[fo&H9C3$x" %?R2C^dGnf4ϓnk[-P3z^