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

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

void Array_move1 () {
-  Array_MindMap (y5);
-  y5--;
-  if (y5==150) {
-    y5++;
-    fill (255);
-    textSize(20);
-    text ("Click mouse left to go to next page", 150, height-45);
-    Array_bicycle(700);
-  }
+Array_MindMap (y5);
+y5--;
+if (y5==150) {
+y5++;
+fill (255);
+textSize(20);
+text ("Click mouse left to go to next page", 150, height-45);
+Array_bicycle(700);
 }
+}
+
 void Array_move2 () {
-  Array_2_Article (y4);
-  y4--;
-  if (y4==120) {
-    y4++;
-  }
+Array_2_Article (y4);
+y4--;
+if (y4==120) {
+y4++;
 }
-//////////////////////////////////////////////////////////////con///////////////////////////////////////////////////////////////////
-void teachCondition() {
-  Background1();
-  changeConPage();
 }
-void changeConPage() {
-  switch (change_con) {
-  case 0:
-    teachIfelse();
-    break;
 
-  case 1:
-    teachLoop();
-    break;
+void Array_move3 () {
+Array_3_Article (y6);
+y6--;
+if (y6==120) {
+y6++;
+}
+}
 
-  case 2:
-    teachFlowChart();
-    break;
-  case 3:
-    Condition2();
-    break;
-  }
+void practice (int y7) {
+background (153, 0, 153);
+noStroke();
+fill (255, 255, 102);
+quad ((width/2), -250, width+250, (height/2), (width/2), height+250, -250, (height/2));
+
+fill (0);
+textSize(45);
+text ("Practice", (width/2)-90, 70);
+
+fill (51, 0, 0);
+textSize(30);
+text ("Write a program to show Addditions results", (width/2)-300, y7);
+text ("of a number between 1-100.", (width/2)-300, y7+30);
+textSize (25);
+fill (0, 0, 102);
+text ("SLOVE:", 80, y7+80);
+textSize (20);
+fill (255, 51, 102);
+text ("Step 1 : Declare a variable according to the directive", 120, y7+130);
+text ("by x1 = 1;", 100, y7+160);
+text ("x2 = 100;", 100, y7+190);
+text ("result is a result of Additions", 100, y7+220);
+text ("In general, we can calculate the sums ranging from 1-100 of this theroem.", 100, y7+250);
+text ("(the first number + the last number) * (the last number / 2).", 100, y7+280);
+text ("void setup (){", 100, y7+310);
+text ("int x1 = 1;", 100, y7+340);
+text ("int x2 = 100;", 100, y7+370);
+text ("int result;", 100, y7+400);
+text ("result = (x1+x2)+(x2/2);", 100, y7+430);
+text ("print (''result=''+result);", 100, y7+460);
+text ("}", 100, y7+490);
 }
-void teachIfelse() {
-  int xCon1=100;
-  int xCon2=150;
-  int xCon3=100;
-  fill(255);
-  textSize(20);
-  text("If-else", 430, 80);
-  stroke(255);
-  //  if (xCon1<=100) {
-  //    xCon1+=1.7;
-  //  }
-  //  else {
-  //    xCon1=101;
-  //  }
-  line(430, 85, 495, 85);
-  fill(#DED636);
-  textSize(17);
-  text("If : Allows the program to make a decision about which code to execute.", xCon1+50, 120);
-  text("If the test evaluates to true, the statements enclosed within the block are executed", xCon1, 160);
-  text("and if the test evaluates to false the statements are not executed.", xCon1, 200);
-  ///////////////////////////////////////////////////////////////////////////////////////////////////
-  //  if (xCon2>=150) {
-  //    xCon2-=1.7;
-  //  }
-  //  else {
-  //    xCon2=149;
-  //  }
-  fill(#8AC1F0);
-  text("else : Extends the if structure allowing the program to choose between", xCon2, 240);
-  text(" two or more block of code. It specifies a block of code to execute", xCon2-50, 280);
-  text("when the expression in if is false.", xCon2-50, 320);
-  //////////////////////////////////////////////////////////////////////////////////////////////////// 
-  //  if (xCon3<=100) {
-  //    xCon3+=1.7;
-  //  }
-  //  else {
-  //    xCon3=101;
-  //    //    ButtonChangePage(820, 550, "Press Key 1");
-  //  }
-  fill(255);
-  text("* example *", xCon3+100, 360);
-  text("int x=30;", xCon3+300, 400);
-  text("if( x < 20 ){", xCon3+300, 440);
-  text("println(100);", xCon3+330, 480);
-  text("}else{", xCon3+300, 520);
-  text("println(200);", xCon3+330, 560);
-  text("}", xCon3+330, 600);
-  text("}", xCon3+300, 640);
+
+void Practice_move () {
+practice (y7);
+y7--;
+if (y7==120) {
+y7++;
 }
-void teachLoop() {
-  int yCon1=120;
-  int yCon2=360;
-  //  if (yCon1<=120) {
-  //    yCon1+=1.7;
-  //  }
-  //  else {
-  //    yCon1=121;
-  //  }
-  fill(255);
-  textSize(20);
-  text("Loop", 430, 80);
-  stroke(255);
-  line(430, 85, 480, 85);
-  textSize(15);
-  fill(#B2CCFF);
-  text("For Loop : A basic for structure has three parts: init, test, and update.", 150, yCon1);
-  text("Each part must be separated by a semicolon (;). The loop continues until the test evaluates to false,", 100, yCon1+40);
-  text("When a for structure is executed.", 100, yCon1+80);
-  fill(255);
-  text("* example *", 200, yCon1+120);
-  text("for (int i = 0; i < 80; i = i+5) {", 340, yCon1+120);
-  text("line(30, i, 80, i);", 380, yCon1+160);
-  text("}", 340, yCon1+200);
-  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-  //  if (yCon2>=360) {
-  //    yCon2-=1.7;
-  //  }
-  //  else {
-  //    yCon2=359;
-  //    //    ButtonChangePage(820, 550, "Press Key 2");
-  //  }
-  fill(#F793E2);
-  text("While Loop : executes a series of statements continuously while the expression is true.", 150, yCon2);
-  text("The expression must be updated during the repetitions or the program will never break out of while.", 100, yCon2+40);
-  fill(255);
-  text("* example *", 200, yCon2+80);
-  text("int i = 0;", 340, yCon2+80);
-  text("while (i < 80) {", 340, yCon2+120);
-  text("line(30, i, 80, i);", 380, yCon2+160);
-  text("i = i + 5;", 380, yCon2+200);
-  text("}", 340, yCon2+240);
-}
-void teachFlowChart() {
-  PImage Img1 = loadImage("http://www.zentut.com/wp-content/uploads/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();
-  }
 }

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

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