xxxxxxxxxx
38
var scl = 40;
var segmSize = scl - 8;
var population;
var popCount = 100;
var mutRate = 0.01;
var wEdge;
var hEdge;
function setup() {
createCanvas(400, 400);
wEdge = width/scl + 1;
hEdge = height/scl + 1;
population = new Population(popCount, mutRate);
//frameRate(10);
}
function draw() {
// field
field();
// population
population.update();
}
function field()
{
background(51);
noFill();
stroke(255, 0, 105);
for (let i = 0; i < width; i += scl)
for (let j = 0; j < height; j += scl)
rect(i, j, i + scl, j + scl)
rect(0, 0, width, height);
}