INNER CODE UNIT · JavaScript
draw
ren-yuan/c2.js · examples for p5.js/Chromosome1.js:36
function draw() {
background('#cccccc');
noStroke();
fill(rectColor);
rect(0, 0, width/2, height);
let info = p.fitness();
textSize(12);
textStyle(NORMAL);
textAlign(LEFT, TOP);
noStroke();
fill('#333333');
let x = width / 2 + 20;
let y = 20;
for (let i = 0; i < p.chromosomes.length; i++) {
let string = p.chromosomes[i].toString(true);