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