Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- @SuppressWarnings("resource")
- Scanner mScanner= new Scanner(System.in);
- int first = mScanner.nextInt();
- int second = mScanner.nextInt();
- int third = mScanner.nextInt();
- int fourth = mScanner.nextInt();
- System.out.println("Was ist 10x5?");
- int adv = 1;
- //Abfragen ob Spieler die erste Aufgabe beim 1. Versuch geschafft hat oder nicht.
- if (first == 50) {
- System.out.println("Richtig! Auf zu Level 2!");
- System.exit(0);
- //Abfragen ob Spieler die erste Aufgabe beim 2 Versuch geschafft hat oder nicht.
- }
- if (second != 50 && adv == 1) {
- System.out.println("Falsch! Du hast noch 2 Versuche.");
- ++adv;
- if (second == 50 && adv == 2) {
- System.out.println("Richtig! Bei deinem 2 Versuch! Auf zu Level 2!");
- System.exit(0);
- }
- //Abfragen ob der Spieler die erste Aufgabe beim 3. Versuch geschafft hat oder nicht.
- }
- if (third != 50 && adv == 2) {
- System.out.println("Schon wieder falsch! Du hast noch einen Versuch.");
- System.exit(0);
- ++adv;
- if (third == 50 && adv == 3) {
- System.out.println("Beim 3 Versuch geschafft! Glückwunsch, auf zu Level 2!");
- System.exit(0);
- //Abfragen ob der Spieler die erste Aufgabe beim 3. Versuch geschafft hat oder nicht.
- }
- }
- if (fourth != 50 && adv == 3) {
- System.out.println("Game Over! Du bist echt schlecht. Starte das Spiel neu, um es erneut zu versuchen.");
- System.exit(0);
- ++adv;
- if (fourth == 50 && adv == 4) {
- System.out.println("Zum Glück! Auf zu Level 2!");
- System.exit(0);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement