var द, , ࣘب;
var x = द;
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
}
function draw() {
ਤ(100, 800, 10);
}
function ਤ(द, , ࣘب) {
background(255);
stroke(100);
strokeWeight(4);
line(द, 200, , 200);
strokeWeight(30);
point(द, 200);
point(, 200);
noStroke();
fill(255, 0, 0);
ellipse(x, 200, 20, 20);
if (x < ) {
x = x + ࣘب;
} else {
x = द;
}
}
변수 선언
위치 지정
원 그리기
조건문