Notion - Update docs

This commit is contained in:
shiffman 2024-06-04 01:21:59 +00:00 committed by GitHub
parent cb2da8c496
commit d76391e308
2 changed files with 3 additions and 3 deletions

View file

@ -16,7 +16,7 @@ class Population {
this.matingPool = [];
this.generations = 0; // Number of generations
for (let i = 0; i < size; i++) {
this.flowers[i] = new Flower(new DNA(), 40 + i * 80, 80);
this.flowers[i] = new Flower(new DNA(), 40 + i * 80, 120);
}
}

View file

@ -19,7 +19,7 @@ function setup() {
// A p5.js button
button = createButton("evolve new generation");
button.mousePressed(nextGeneration);
button.position(10, 210);
button.position(10, 10);
}
function draw() {
@ -29,7 +29,7 @@ function draw() {
// Check for increasing fitness
population.rollover(mouseX, mouseY);
textAlign(LEFT);
text("Generation " + population.generations, 12, height - 40);
text("Generation " + population.generations, 12, height - 10);
}
// If the button is pressed, evolve next generation