-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArcheryGame.java
More file actions
54 lines (35 loc) · 1.06 KB
/
ArcheryGame.java
File metadata and controls
54 lines (35 loc) · 1.06 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
public class ArcheryGame{
public static String gameWelcomeMenu() {
return """
<<--<<--<<-- Welcome to Semicolon ArcheryGame -->>-->>-->>
__________________________________________________________
""";
}
public static int[][] generateRandomNumbers(int[][] scores) {
for (int players = 0; players < 4; players++) {
for (int chance = 0; chance < 3; chance++) {
scores[player][chance] = random.nextInt(11);
}
}
}
public static int calculateTotalScores (int[] totalScores) {
for (int player = 0; player < 4; player++) {
totalScores[player] = scores[player][0] + scores[player][1] + scores[player][2];
}
}
public static int determineTheWiner (int winner) {
for (int player = 0; player < 4; player++) {
if (totalScores[player] > highestScore) {
highestScore = totalScore[player];
winner = player;
}
}
}
public static void main (String... args) {
Random random = new Random();
int[][] scores = new int [4]]3];
int[] totalScores = new int[4];
int higestScore = 0;
int winner = -1;
}
}