forked from CidWB/COMP3607_Jeopardy_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
41 lines (24 loc) · 1.01 KB
/
Main.java
File metadata and controls
41 lines (24 loc) · 1.01 KB
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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Welcome to the Jeopardy Game!");
System.out.print("Enter question file format (csv, json, xml): ");
String fileFormat = scanner.nextLine();
System.out.print("Enter question file path: ");
String filePath = scanner.nextLine();
System.out.print("Enter number of players: ");
int numPlayers = scanner.nextInt();
scanner.nextLine(); // Consume newline
GameConfig config = new GameConfig();
config.getFile(fileFormat, filePath);
GameEventLogPublisher publisher = new GameEventLogPublisher();
config.addPlayers(numPlayers, publisher);
Game game = Game.getInstance();
game.setupGame(config);
game.playGame();
scanner.close();
System.out.println("Thank you for playing!");
System.out.println("Goodbye!");
}
}