-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
34 lines (19 loc) · 736 Bytes
/
Copy pathMain.java
File metadata and controls
34 lines (19 loc) · 736 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
28
29
30
31
32
33
34
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner mainScanner = new Scanner(System.in);
while (true){
System.out.println("Введи 'д', чтобы начать новую игру или 'н', чтобы выйти.");
String ans = mainScanner.nextLine();
if (ans.equals("д")){
Game game = new Game(WordUtils.getRandomWord());
game.play();
} else if (ans.equals("н")) {
System.out.println("Пока!");
break;
} else {
System.out.println("Не понял твоей команды :(");
}
}
}
}