-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
23 lines (20 loc) · 853 Bytes
/
Main.java
File metadata and controls
23 lines (20 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
if (args.length != 1) {
System.out.println(Arrays.toString(args));
System.out.println(
"Blędna ilość argumentów. powinines jako pierwszy argument podac liczbe wskazujaca na maskylany zakres losownych liczb. Poda liczba argumentow: "
+ args.length);
System.out.println("Poprawny przyklad uruchomienia: \"java Main 4\"");
System.exit(1);
}
if (args[0].matches("\\d+")) {
int upperlimit = Integer.parseInt(args[0]);
Game game = new Game(upperlimit, 3);
game.play();
} else {
System.out.println("Gorny limit musi byc liczba calkowita dodatnia! Spróbuj ponownie");
}
}
}