-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
37 lines (34 loc) · 1.14 KB
/
Main.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
package battleship;
import java.util.Scanner;
import javafx.application.Application;
public class Main {
/**
* Main method allows user to select which view they would like to use
*
* @param args
*/
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
System.out.println("Select Game Version ");
System.out.println("1: Battleship CLI");
System.out.println("2: Battleship GUI");
boolean validOption = false;
while (!validOption) {
int option = kb.nextInt();
switch (option) {
case 1:
BattleShipViewCLI battleShipViewCLI = new BattleShipViewCLI();
battleShipViewCLI.newGameCLI();
validOption = true;
break;
case 2:
Application.launch(BattleShipViewGUI.class, args);
validOption = true;
break;
default:
System.out.println("Invalid option");
break;
}
}
}
}