Sfoglia il codice sorgente

Hinfuegen der Kommentare

ZhaoXue 2 anni fa
parent
commit
6a1717f451
1 ha cambiato i file con 7 aggiunte e 8 eliminazioni
  1. 7 8
      BELEG3.ino

+ 7 - 8
BELEG3.ino

@@ -80,7 +80,7 @@ byte menu()                   //Erstellung des Menue
   blink(&red);
   blink(&red);
   blink(&red);
-  if (digitalRead(2) == LOW)  //Einfacher Mode
+  if (digitalRead(2) == LOW)  //Einfaches Modemenu
   {
     for(int i=1;i<=2;i++)
        {digitalWrite(red, HIGH);digitalWrite(green, HIGH);digitalWrite(blue, HIGH);
@@ -90,7 +90,7 @@ byte menu()                   //Erstellung des Menue
        }
     return 2;
   }
-  else if (digitalRead(3) == LOW)
+  else if (digitalRead(3) == LOW)  //Schwieriges Modemenu
   { 
     for(int i=1;i<=3;i++)
      {digitalWrite(red, HIGH);digitalWrite(green, HIGH);digitalWrite(blue, HIGH);
@@ -103,11 +103,11 @@ byte menu()                   //Erstellung des Menue
   {return 0;}
 } 
 
-void game()
+void game()          //unterprogramm vom Spiel
 { int j=0,k=0;
-  for(;;){
+  for(;;){           //Spielschleife
   
-  if(!prufmode)
+  if(!prufmode)      
   {
     digitalWrite(green, HIGH);
   for(int i=1;i<=10;i++)
@@ -130,11 +130,10 @@ void game()
         prufmode=true;
         
       }
-      
       }
       }
   }
-  else
+  else                                 //prufen der Eingabe
         {digitalWrite(green, LOW);digitalWrite(blue, HIGH);
         for(int i=1;i<=10;i++)
                   {if (digitalRead(i) == LOW)
@@ -152,7 +151,7 @@ void game()
           if(k==j)
           prufmode=false;
           }
-  if(gameover)
+  if(gameover)                //Gameover
   
   { for(int i=1;i<=j;i++){
       digitalWrite(red, HIGH);digitalWrite(green, HIGH);digitalWrite(blue, HIGH);