วันอาทิตย์ที่ 23 สิงหาคม พ.ศ. 2558

lab1-battery

void setup(){
size(400,300);
background(255);
strokeWeight(2);
stroke(0);
fill(0);
int X=50;
int Y=100;
int width=150;
int high=100;

//Batterry
rect(X+200 , Y+25 , width-25 , high-50);
//red
fill(#FF0000);
rect(X , Y , width , high);
//yellow
fill(#FFFF00);
rect(X+100 , Y , width , high);
//green
fill(#00FF00);
rect(X+180 , Y , width-50 , high);

}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น