-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainClass.java
More file actions
48 lines (40 loc) · 1.36 KB
/
mainClass.java
File metadata and controls
48 lines (40 loc) · 1.36 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
42
43
44
45
46
47
48
import java.util.Scanner;
public class mainClass {
static Scanner sc = new Scanner(System.in);
static int maxAttemps = 8;
public static void main(String[] args) {
theMan theMan = new theMan();
MessageOut(theMan.theMan[7]);
menu gameMenu = new menu();
Boolean isTrue = true;
while (isTrue) {
//
MessageOut("Welcome to Hangman.\nEnter 1.Start the game 2.Options 3.Exit the game");
String userInput = sc.nextLine();
switch (userInput) {
case "1":
gameMenu.gameMenu(sc);
break;
// case "2":
// Options();
// break;
case "3":
MessageOut("Thank you for playing.");
isTrue = false;
break;
default:
MessageOut("Please enter a valid number from above");
userInput = sc.nextLine();
break;
}
}
sc.close();;
}
// public static void Options(){
// maxAttemps = Integer.parseInt(sc.nextLine());
// }
public static void MessageOut(String text) {
// dont want to type "System.out.println()" everytime
System.out.println(text);
}
}