コード例 #1
0
 private void performYellow(Foor foor, String cicle) {
   if (cicle.equals("down")) {
     foor.vahetaKollast();
     foor.paus(0.5);
     foor.vahetaKollast();
     foor.vahetaPunast();
   } else if (cicle.equals("up")) {
     foor.vahetaKollast();
     foor.paus(0.5);
     foor.vahetaKollast();
   }
 }
コード例 #2
0
  private void performGreen(Foor foor) {
    foor.vahetaRohelist();
    foor.paus(1.0);
    foor.vahetaRohelist();

    for (int i = 0; i < 6; i++) {
      foor.vahetaRohelist();
      foor.paus(0.5);
    }

    foor.vahetaRohelist();
  }
コード例 #3
0
 private void performRed(Foor foor) {
   foor.vahetaPunast();
   foor.paus(3);
 }
コード例 #4
0
  public void tsykkel(Foor foor, int suund) {
    int count = suund;
    while (count < 10) {
      if (count != 0) {

        foor.vahetaRohelist();
        foor.paus(0.5);
        foor.vahetaRohelist();
        foor.paus(0.5);
        foor.vahetaRohelist();
        foor.paus(0.5);
        foor.vahetaRohelist();
        foor.paus(0.5);
        foor.vahetaKollast();
        foor.paus(0.5);
        foor.vahetaKollast();
        foor.paus(0.5);
        foor.vahetaPunast();
        foor.paus(1.5);
        foor.vahetaPunast();
        foor.paus(0.5);
      }

      foor.vahetaPunast();
      foor.paus(1.5);
      foor.vahetaPunast();
      foor.paus(0.5);
      foor.vahetaKollast();
      foor.paus(0.5);
      foor.vahetaKollast();
      foor.paus(0.5);
      foor.vahetaRohelist();
      foor.paus(0.5);
      foor.vahetaRohelist();
      foor.paus(0.5);
      foor.vahetaRohelist();
      foor.paus(0.5);
      foor.vahetaRohelist();
      foor.paus(0.5);

      count++;
    }
  }