Skip to content

Commit 0a7360f

Browse files
github-actionsSteffenLm
authored andcommitted
Google Java Format
1 parent 426fd64 commit 0a7360f

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

Exercise.java

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,35 @@
44
public class Exercise {
55

66
public static void main(String[] args) {
7-
@SuppressWarnings("resource")
8-
Scanner sc = new Scanner(System.in);
7+
@SuppressWarnings("resource")
8+
Scanner sc = new Scanner(System.in);
99

10-
Random rnd = new Random();
11-
int randomNumber = rnd.nextInt(100) + 1;
10+
Random rnd = new Random();
11+
int randomNumber = rnd.nextInt(100) + 1;
1212

13-
int attempts = 0;
13+
int attempts = 0;
1414

15-
boolean loop;
16-
do {
17-
attempts++;
15+
boolean loop;
16+
do {
17+
attempts++;
1818

19-
System.out.print("Gib bitte Deinen Tipp ein: ");
20-
int tip = sc.nextInt();
19+
System.out.print("Gib bitte Deinen Tipp ein: ");
20+
int tip = sc.nextInt();
2121

22-
if (tip == randomNumber) {
23-
System.out.println("Richtig. Du hast " + attempts + " Versuche benoetigt");
24-
break;
25-
// return
26-
} else if (tip > randomNumber) {
27-
System.out.println("Leider falsch, die gesuchte Zahl ist kleiner");
28-
} else {
29-
System.out.println("Leider falsch, die gesuchte Zahl ist groesser");
30-
}
22+
if (tip == randomNumber) {
23+
System.out.println("Richtig. Du hast " + attempts + " Versuche benoetigt");
24+
break;
25+
// return
26+
} else if (tip > randomNumber) {
27+
System.out.println("Leider falsch, die gesuchte Zahl ist kleiner");
28+
} else {
29+
System.out.println("Leider falsch, die gesuchte Zahl ist groesser");
30+
}
3131

32-
System.out.print("Moechtest Du nochmals raten (true, false)?: ");
33-
loop = sc.nextBoolean();
34-
} while (loop);
35-
36-
System.out.println("Die gesuchte Zahl war " + randomNumber);
32+
System.out.print("Moechtest Du nochmals raten (true, false)?: ");
33+
loop = sc.nextBoolean();
34+
} while (loop);
3735

36+
System.out.println("Die gesuchte Zahl war " + randomNumber);
3837
}
3938
}

0 commit comments

Comments
 (0)