void setup() { size(350, 150); background(51); textSize(15); int year=12; String power=" " + year + "\n10 = " + powerof_ten(year); text(power, (width-textWidth(power))/2, 75); } String powerof_ten(int number) { String texts; fill(#49E34A); if (number==6) { texts="Million"; } else if (number==9) { texts="Billion"; } else if (number==12) { texts="Trillion"; } else if (number==15) { texts="Quadrillion"; } else if (number==18) { texts="Quintillion"; } else if (number==21) { texts="Sextillion"; } else if (number==30) { texts="Nomillion"; } else if (number==100) { texts="Googol"; } else { fill(255,0,0); texts="No Name"; } return texts; }
วันพฤหัสบดีที่ 3 กันยายน พ.ศ. 2558
Lab03 : Power of ten
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
commit เพิ่มเติม : เพื่ม userstory, bookmark
>> add userstory ทำการเพิ่ม userstory ใน functional tests >> add bookmark for user เพิ่มระบบ Bookmark โดยการสร้าง model ขึ...
-
1 2 3 4 5 6 7 8 9 def setup (): print (d2b( 8 )) def d2b (num): x = "" while num > 0 : x = str ( int (n...
-
1 2 3 4 5 6 7 8 9 10 11 12 13 def test_layout_and_styling ( self ): # Edith goes to the home page self . brow...
-
การใช้ template inheritence คือการสืบทอดเทมเพลต เพื่อให้ไม่ต้องเขียนโค้ดหน้าเว็บๆซ้ำๆ เราจะมีหน้าหลักอันเดียว (base.html or parent) ภายในนั...
ไม่มีความคิดเห็น:
แสดงความคิดเห็น