forked from mastifikator/FantasyJavaPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
35 lines (28 loc) · 1.01 KB
/
Main.java
File metadata and controls
35 lines (28 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
package Strategy;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.Buffer;
public class Main {
public static void main(String[] args){
NightElfBase nightElfBase = new NightElfBase("Лесная Чаща", 3000);
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Укажите кто хочет напасть на базу?");
System.out.println("1 - Орки");
System.out.println("2 - Люди");
System.out.println("3 - Нежить");
int choice = 0;
boolean next = false;
while (!next) {
try {
choice = Integer.parseInt(reader.readLine());
next = true;
} catch (Exception e) {
next = false;
System.out.println("Введите цифру от 1 до 3");
}
}
nightElfBase.enemyDetected(choice);
}
}