SOURCE

console 命令行工具 X clear

                    
>
console
function setup(){
    createCanvas(500,150);
    rectMode(CENTER);
    background(200);
}

function draw(){
    rect(width/4,height/2,width/3,height/3);
    rect(width*3/4,height/2,width/3,height/3);
}
function setup(){
    createCanvas(500,500);
    background(255);
}
function draw(){
    for(let x=0; x<490; x+=40){
        for(let y=0; y<500; y+=40){
            fill(0);
         rect(x,y,20,20);
    }
  }
 for(let x=20; x<490; x+=40){
        for(let y=20; y<500; y+=40){
            fill(0);
         rect(x,y,15,15);
    }
 }
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.1.9/p5.min.js"></script>