implemented support for else if constructs

This commit is contained in:
weckyy702
2021-01-04 16:43:21 +01:00
parent f9e0d7f4b0
commit 8ba7936311
2 changed files with 29 additions and 22 deletions

View File

@@ -28,14 +28,12 @@ public class Rover extends Actor
if(richtung.equals("Hoch")) {
pri = "links";
sec = "rechts";
} else {
if (richtung.equals("Runter")) {
pri = "rechts";
sec = "links";
} else {
nachricht("JUNGE DU SPAST!");
return;
}
} else if (richtung.equals("Runter")) {
pri = "rechts";
sec = "links";
} else {
nachricht("JUNGE DU SPAST!");
return;
}
drehe(pri);
fahre();