forked from Yandex-Practicum/Java-Module-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (26 loc) · 805 Bytes
/
Main.java
File metadata and controls
30 lines (26 loc) · 805 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
import java.util.Objects;
import java.util.Scanner;
public class Main {
static Race race = new Race();
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String command = "start";
while(true)
{
if(Objects.equals(command, "start"))
{
if(race.commandStart())
{
command = scanner.nextLine();
}
} else if(Objects.equals(command, "exit"))
{
System.out.println("Завершаем работу.");
break;
} else {
System.out.println("Комманда не распознана.");
command = scanner.nextLine();
}
}
}
}