論理思考とプログラミング2011s#09

784 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
784
On SlideShare
0
From Embeds
0
Number of Embeds
131
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

論理思考とプログラミング2011s#09

  1. 1. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7 #09N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)
  2. 2. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7•  1 "   "   1 1 "   "• 
  3. 3. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7TIPS: background(0);" ellipse(30, 48, 36,36);" smooth();" ellipse(70, 48, 36, 36);
  4. 4. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7TIPS:•  save(“ ”);"   "   "•  "   tiff, TARGA, jpg, png"   "   aaa.png / aaa.jpg / aaa.tif"
  5. 5. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7if :if( ){" "}
  6. 6. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7elseif ( {" "}else{" "}
  7. 7. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7•  true false "•  "   true / false"   boolean "   "   "   boolean
  8. 8. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7
  9. 9. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7int a = random(0, 10);"if(a < 5){" ellipse(10, 10, 40, 40);"}else{" rect(10, 10, 40, 40);"}
  10. 10. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7float a = random(0, 10);"if(int(a) == 5){" ellipse(10, 10, 40, 40);"}else{" rect(10, 10, 40, 40);"}
  11. 11. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7&&
  12. 12. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7float a, b;"a = random(0, 10); b = random(0, 10);"if(a < 5 && b > 5){"ellipse(10, 10, 40, 40);"}else{" rect(10, 10, 40, 40);"}
  13. 13. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7||
  14. 14. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7float a, b;"a = random(0, 10); b = random(0, 10);"if(a < 5 || b > 5){" ellipse(10, 10, 40, 40);"}else{" rect(10, 10, 40, 40);"}
  15. 15. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7else ifif( 1){" 1 "}else if( 2){" 1 " 2 "}else{" 1 2 "}"
  16. 16. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7int a = random(0, 10);"if(a < 5){" ellipse(10, 10, 40, 40);"}else if(a < 7){" rect(10, 10, 40, 40);"}else{" triangle(30, 75, 58, 20, 86, 75);"}
  17. 17. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/71 •  400 " •  " •  3 1 " •  3 1 " •  3 1 " •  " •  20 40
  18. 18. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7XX
  19. 19. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7int a = random(0, 10);"if(a < 5){" ellipse(10, 10, 40, 40);"}else{" rect(10, 10, 40, 40);"}
  20. 20. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/72 •  "   "   = 6 : 4"   20×20" •  400×400" •  "
  21. 21. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7if ( i > 200){" if( j < 200){ ellipse(i, j, 10, 10);}"}else{" while( j < 100){ rect(i, j, 10, 10); j = j + 1)}"}
  22. 22. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7
  23. 23. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7•  "   "   (flow driven)"•  "   "   (event driven)
  24. 24. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7 255
  25. 25. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7Processingvoid setup(){""}"void draw(){""}
  26. 26. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7Processingvoid setup(){""}"void draw(){""}
  27. 27. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7Processingvoid setup(){""}"void draw(){""}
  28. 28. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7 255
  29. 29. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7•  "   "   {} "•  "   "   "
  30. 30. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7•  "   "   "   "•  "   "   "
  31. 31. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7setupfloat x, y;" 200 200
  32. 32. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7draw: -
  33. 33. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7-
  34. 34. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7
  35. 35. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7• draw "   "  FPS (Frame Per Second)"• frameRate(< >)"   > "  E.g. frameRate(30); 30 "
  36. 36. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7int x, y;"void setup(){" x = 0;" y = 0;" fill(255, 255, 255);"}"
  37. 37. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7void draw(){" background(0, 0, 0);" ellipse(x, y, 10, 10);" x = x + 1;"}"
  38. 38. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7 3•  (0, 0) "•  "• 
  39. 39. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7 4•  "• • 1 "
  40. 40. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7mouseX, mouseY, mousePressed•  "• mouseX : X "• mouseY Y "• mousePressed"   true"   false"
  41. 41. N. Shiimizu (chiko@sfc.keio.ac.jp / @ chikoski) 2011/07/7void setup(){" fill(255, 255, 255);"}"void draw(){" if(mousePressed){" ellipse(mouseX, mouseY, 10, 10);" }"}"

×