วันพุธที่ 17 ธันวาคม พ.ศ. 2557

ส่วนที่แก้ไขต่างๆจาก bitbucket (4)

+void teachFlowChart() {
+PImage Img1 = loadImage("http://www.zentut.com/…/upl…/2007/12/c-if-else-statement.png", "png");
+PImage Img2 = loadImage("http://www.functionx.com/cpp/images/flowchart11.gif", "gif");
+image(Img1, 100, 200);
+image(Img2, 490, 200);
+fill(255);
+textSize(20);
+text("Flowchart", 400, 80);
+stroke(255);
+line(400, 85, 490, 85);
+text("If-else", 210, 160);
+text("Loop", 610, 160);
+// ButtonChangePage(820, 600, "Press Key 3");
+}
+void Condition2() {
+strokeWeight(1);
+methodIf();
+}
+void methodLoop() {
+strokeWeight(1);
+textSize(20);
+text("Explanation of ' Loop ' working methods", 260, 80);
+fill(255);
+rect(310, 150, 280, 60);
+fill(‪#‎FFAAAA‬);
+ellipse(x_roll+g_roll, y_fall, 50, 50);
+if (x_roll<550) {
+x_roll+=2;
+} else {
+if (g_roll<-200) {
+x_roll=350;
+g_roll=0;
+} else {
+g_roll-=2;
+}
+}
+if (keyCode==DOWN&&(x_roll>350)&&(x_roll<550)) {
+x_roll=450;
+y_fall+=3;
+textSize(50);
+fill(‪#‎F59607‬);
+text("Out of Loop!", 300, 450);
+textSize(20);
+fill(‪#‎F096D5‬);
+text("False", 230, 180);
+} else {
+textSize(20);
+fill(‪#‎80E3AF‬);
+text("True", 230, 180);
+fill(‪#‎EEFC2E‬);
+text("Suppose the White box is a loop condition", 250, 280);
+text("and pink ball is work in a true statements", 255, 320);
+fill(#7590F7);
+text("Press 'Down key' to make 'false' statements", 250, 400);
+stroke(#7590F7);
+line(450, 430, 450, 510);
+line(440, 500, 450, 520);
+line(450, 520, 460, 500);
+}
+}
+void methodIf() {
+textSize(20);
+text("Explanation of ' if-else ' working methods", 250, 80);
+strokeWeight(5);
+// stroke(#86E0FF);
+// line(250, 130, 250, height-20); //if
+// line(350, 130, 350, height-20);
+// stroke(#F07777);
+// line(550, 130, 550, height-20); //else
+// line(650, 130, 650, height-20);
+stroke(#E8E3C0);
+fill(#E8E3C0);
+quad(350, 170, 450, 120, 550, 170, 450, 240); //condition
+line(170, 170, 400, 170); //left
+line(170, 170, 170, 250);
+line(160, 240, 170, 250);
+line(180, 240, 170, 250);
+line(170, 300, 170, 530);
+rect(50, 260, 210, 100);
+line (500, 170, 730, 170); //right
+line(730, 170, 730, 360);
+line(720, 350, 730, 360);
+line(740, 350, 730, 360);
+line(740, 380, 740, 530);
+rect(630, 370, 210, 100);
+
+line(170, 530, 740, 530);
+line(450, 530, 450, 600);
+
+ellipse(450, 620, 100, 50);
+stroke(#FFAAAA);//ball
+fill(#FFAAAA);
+ellipse(x_pos_ball, y_pos_ball, 50, 50);
+fill(#050EF7);
+text("if", 150, 290);
+text("The true statements", 60, 330);
+fill(#F02CA1);
+text("else", 710, 410);
+text("The false statements", 640, 450);
+fill(0);
+text("CONDITION", 395, 175);
+text("END", 430, 625);
+if (y_pos_ball<=350) {
+y_pos_ball++;
+if (y_pos_ball>=280) {
+fill(255);
+text("When it false", 390, 380);
+stroke(255);
+line(390, 420, 480, 420);
+line(480, 410, 500, 420);
+line(500, 420, 480, 430);
+}
+} else if (y_pos_ball>350&&y_pos_ball<850) {
+x_pos_ball=730;
+y_pos_ball++;
+if (y_pos_ball>=550) {
+x_pos_ball=450;
+y_pos_ball++;
+}
+} else {
+Background1();
+methodLoop();
+}
+}
+
 void Function_1 () {
-  background (255, 153, 153);
-  for (int x = 0; x<width; x=x+260) {
-    noStroke();
-    fill (255, 255, 153);
-    rect (x, 0, 130, height);
-  }
-  fill (51, 0, 102);
-  textSize(45);
-  text ("FUNCTION", (width/2)-110, 70);
-  Function_1_move ();
+background (255, 153, 153);
+for (int x = 0; x<width; x=x+260) {
+noStroke();
+fill (255, 255, 153);
+rect (x, 0, 130, height);
+}
+fill (51, 0, 102);
+textSize(45);
+text ("FUNCTION", (width/2)-110, 70);
+Function_1_move ();
 }
 
 void Function_2() {
-  background (255, 255, 0);
-  noStroke();
-  fill (102, 51, 0);
-  ellipse (width/2, height/2, 950, 750);
+background (255, 255, 0);
+noStroke();
+fill (102, 51, 0);
+ellipse (width/2, height/2, 950, 750);
 
-  fill (255);
-  textSize(45);
-  text ("FUNCTION", (width/2)-110, 70);
-  Function_2_move ();
+fill (255);
+textSize(45);
+text ("FUNCTION", (width/2)-110, 70);
+Function_2_move ();
 }
 
 void Function_3() {
-  background (255, 51, 102);
-  noStroke();
-  fill (255, 255, 0);
-  ellipse (width/2, height/2, 950, 750);
+background (255, 51, 102);
+noStroke();
+fill (255, 255, 0);
+ellipse (width/2, height/2, 950, 750);
 
-  fill (0);
-  textSize(45);
-  text ("FUNCTION", (width/2)-110, 70);
-  Function_3_move ();
+fill (0);
+textSize(45);
+text ("FUNCTION", (width/2)-110, 70);
+Function_3_move ();
 }
 
 void Function_System (int y2) {
-  fill (204, 255, 102);
-  textSize(30);
-  text ("System Function", (width/2)-110, 120);
-  textSize (25);
-  text ("The system functions are already available to run it.", 150, 150);
+fill (204, 255, 102);
+textSize(30);
+text ("System Function", (width/2)-110, 120);
+textSize (25);
+text ("The system functions are already available to run it.", 150, 150);
 
-  fill (255, 153, 153);
-  rect (100, y2, 200, 100, 10);
-  rect (100, y2+200, 200, 100, 10);
-  fill (153, 255, 0);
-  rect (630, y2, 200, 50, 20);
-  rect (630, y2+200, 200, 50, 20);
-  fill (102, 255, 255);
-  rect (650, y2+70, 150, 50, 20);
-  rect (650, y2+270, 150, 50, 20);
+fill (255, 153, 153);
+rect (100, y2, 200, 100, 10);
+rect (100, y2+200, 200, 100, 10);
+fill (153, 255, 0);
+rect (630, y2, 200, 50, 20);
+rect (630, y2+200, 200, 50, 20);
+fill (102, 255, 255);
+rect (650, y2+70, 150, 50, 20);
+rect (650, y2+270, 150, 50, 20);
 
-  fill (102, 0, 51);
-  textSize (25);
-  text ("WITH", 170, y2+40);
-  text ("PARAMETER", 130, y2+70);
-  text ("WITHOUT", 150, y2+240);
-  text ("PARAMETER", 130, y2+270);
+fill (102, 0, 51);
+textSize (25);
+text ("WITH", 170, y2+40);
+text ("PARAMETER", 130, y2+70);
+text ("WITHOUT", 150, y2+240);
+text ("PARAMETER", 130, y2+270);
 
-  fill (0);
-  textSize(20);
-  text ("View Source Code", 640, y2+30);
-  text ("View Source Code", 640, y2+230);
-  text ("Code Sample", 660, y2+100);
-  text ("Code Sample", 660, y2+300);
+fill (0);
+textSize(20);
+text ("View Source Code", 640, y2+30);
+text ("View Source Code", 640, y2+230);
+text ("Code Sample", 660, y2+100);
+text ("Code Sample", 660, y2+300);
 
-  fill (255);
-  textSize (20);
-  text ("Mouse over to read the description", (width/2)-150, y2+445);
-  text ("Click mouse left to go to next page", (width/2)-150, y2+470);
+fill (255);
+textSize (20);
+text ("Mouse over to read the description", (width/2)-150, y2+445);
+text ("Click mouse left to go to next page", (width/2)-150, y2+470);
 }
 

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

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