วันพฤหัสบดีที่ 3 กันยายน พ.ศ. 2558

Lab03 : Leap year

void setup() {
  size(350, 150); 
  background(51);
  textSize(15);
  int yearr=1976;
  String leapyear_t=yearr + " is " + leapyear(yearr);
  text(leapyear_t, (width-textWidth(leapyear_t))/2, 75);
  for (int i=0;i<401;i++){
   println(1804+i +" is " +leapyear(1804+i)); 
  }
}

String leapyear(int number) {
  String texts;
  if ((number%4==0 && number%100!=0) || (number%4==0 && number%100==0 && number%400==0)) {
    fill(#49E34A);
    texts="a Leap Year";
  } else {
    fill(#E50505);
    texts="not a Leap Year";
  }
  return texts;
}


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

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

commit เพิ่มเติม : เพื่ม userstory, bookmark

>>  add userstory ทำการเพิ่ม userstory ใน functional tests >>  add bookmark for user เพิ่มระบบ Bookmark โดยการสร้าง model ขึ...