-
Notifications
You must be signed in to change notification settings - Fork 0
/
FloodIt.java
executable file
·41 lines (33 loc) · 1.04 KB
/
FloodIt.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* The class <b>FloodIt</b> launches the game
*
* @author Guy-Vincent Jourdan, University of Ottawa
*/
public class FloodIt {
/**
* <b>main</b> of the application. Creates the instance of GameController
* and starts the game. If a game size (>10) is passed as parameter, it is
* used as the board size. Otherwise, a default value is passed
*
* @param args
* command line parameters
*/
public static void main(String[] args) {
StudentInfo.display() ;
int size = 10;
//int size = 17;
//int size = 22;
if (args.length == 1) {
try{
size = Integer.parseInt(args[0]);
if(size<10){
System.out.println("Invalide argument, using default...");
size = 12;
}
} catch(NumberFormatException e){
System.out.println("Invalide argument, using default...");
}
}
GameController game = new GameController(size);
}
}