mirror of
https://github.com/nature-of-code/noc-book-2
synced 2024-11-16 07:47:48 +01:00
Notion - Update docs
This commit is contained in:
parent
cb2da8c496
commit
d76391e308
2 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue