-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
27 lines (24 loc) · 849 Bytes
/
Main.java
File metadata and controls
27 lines (24 loc) · 849 Bytes
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
import java.util.Scanner;
/**
* Main class for the Bluejack card game.
* Entry point for the application.
*/
public class Main {
/**
* Main method to start the game.
* @param args Command line arguments (not used)
*/
public static void main(String[] args) {
String isNewGame = "y";
Game game = new Game();
Scanner scanner = new Scanner(System.in);
while (!isNewGame.equals("n")) {
game.gameLoop();
System.out.println("Do you want to play a new game? [y]es / [n]o");
System.out.println("(If you enter something other than \"y\" or \"n\", a new game will start automatically)");
isNewGame = scanner.next().toLowerCase();
}
System.out.println("Thank you for playing Bluejack!");
scanner.close();
}
}