Repository navigation
Expand file tree
/
Copy pathMain.java
More file actions
78 lines (61 loc) · 2.53 KB
/
Copy pathMain.java
File metadata and controls
78 lines (61 loc) · 2.53 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
public class Main {
public static void main(String[] args) throws InterruptedException {
showGameStartAnimation();
Race race = new Race();
String raceWinnerName = race.findRaceWinner(race.createRace()).name;
showWinner(raceWinnerName);
}
public static void showWinner(String raceWinnerName) throws InterruptedException {
Thread.sleep(500);
String[] fireworks = {
"🎆 ",
" 🎇 ",
" 🎆 ",
" 🎇",
" 🎆 ",
" 🎇 "
};
for (int i = 0; i < 2; i++) {
for (String fire : fireworks) {
System.out.print("\r" + fire);
Thread.sleep(150);
}
}
System.out.println("\n====================================");
System.out.println("🚗💨 " + raceWinnerName.toUpperCase() + " пересёк финиш первым! 💨🚗");
System.out.println("====================================");
String message = "🏆 П О Б Е Д А ! 🏆";
for (int i = 0; i < message.length(); i++) {
System.out.print(message.charAt(i));
Thread.sleep(120);
}
System.out.println("\n🎇 Поздравляем чемпиона! 🎇");
}
public static void showGameStartAnimation() throws InterruptedException {
String[] frames = {
" 🚗💨",
" 🚗💨",
" 🚗💨",
" 🚗💨",
" 🚗💨",
" 🚗💨",
" 🚗💨",
" 🚗💨",
" 🚗💨",
" 🚗💨"
};
for (String frame : frames) {
System.out.print("\r" + frame);
Thread.sleep(150);
}
Thread.sleep(500);
String message = "🚀 И Г Р А Н А Ч А Л А С Ь ! 🚀";
for (int i = 0; i < message.length(); i++) {
System.out.print(message.charAt(i));
Thread.sleep(120);
}
System.out.println("\n===============================");
System.out.println(" Добро пожаловать! ");
System.out.println("===============================");
}
}