Commits

Anonymous committed db28385

made nrSims userselectable

Comments (0)

Files changed (1)

hackathonAlpha.html

 var timer, time;
 var width, height, colWidth, rowHeight;
 var progShow;
-var ctlXRes, ctlYRes, ctlRandomDensity, ctlFramerate;
+var ctlXRes, ctlYRes, ctlRandomDensity, ctlNrSims, ctlFramerate;
 var evoCellData;
 
 function setup()
 {
 	ctlXRes = $('#xres')[0];
 	ctlYRes = $('#yres')[0];
-	ctlRandomDensity = $('#randomDensity');
+	ctlNrSims = $('#nrSims')[0];
+	ctlRandomDensity = $('#randomDensity')[0];
 	ctlFramerate = $('#framerate')[0];
 	
 	document.getElementById('c').addEventListener('click', handleCanvasClick, false);
 	width = parseInt(ctlXRes.value);
 	height = parseInt(ctlYRes.value);
 	
+	nrSimsCols = parseInt(ctlNrSims.value);
+	nrSimsRows = nrSimsCols;
+	
 	colWidth = Math.floor((width / nrSimsCols) - 1);
 	rowHeight = Math.floor((height / nrSimsRows) - 1);
 	
 			arrayBufferData = evt.target.result;
 			var evoCellData = EvoCell.loadEvoCellFile(arrayBufferData);
 			caSims[0].setRule(evoCellData);
-			handleReset();
+			//handleReset();
 		};
 	reader.readAsArrayBuffer(files[0]); // start async operation
   }
 	<input type="number" id="xres" name="xres" min="100" max="4000" value="1000" onchange="handleReset();" />
 	<input type="number" id="yres" name="yres" min="100" max="4000" value="3333" onchange="handleReset();" />
 	<input type="number" id="randomDensity" min="0" max="1" step="0.001" value="0.01" onchange="handleReset();">
+	<input type="number" id="nrSims" min="1" max="6" step="1" value="5" onchange="handleReset();">
 	<input type="button" value="Reset" onclick="handleReset();">
 	<input type="file" value="evocellFile" id="evocellFile" />
 	fps<input size="1" id="framerate">