SOURCE

console 命令行工具 X clear

                    
>
console
let speed=5;
let x;
let y;
let x1;
let y1;
let x2;
let y2;
function setup(){
    createCanvas(230,250);
    x=width/3;
    y=height/1;
    x1=width/2;
    y1=height/2;
    x2=width/2;
    y2=height/3;
    background(0);
}
function draw(){
    x+=random(-speed,speed);
    y+=random(-speed,speed);
    x1+=random(-speed,speed);
    y1+=random(-speed,speed);
    x2+=random(-speed,speed);
    y2+=random(-speed,speed);
    triangle(x,y,x1,y1,x2,y2,);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.1.9/p5.min.js"></script>