-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.java
More file actions
71 lines (57 loc) · 2 KB
/
Copy pathGame.java
File metadata and controls
71 lines (57 loc) · 2 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
/**
* Input: Two team skill integers, dictated by NHL Simulator class
* Skill Modificatiion: Randomly decides if team will play well and alters team skill
* Uses team skill to randomly determine game score
* Output: Returns the game score in an int
*/
import java.util.Random;
public class Game {
// Method that modifies forward skill level
public int changeForwardSkill(int forwardSkill) {
Random rand = new Random(System.currentTimeMillis());
int fate = rand.nextInt(2);
if (fate == 1) {
// Team's forwards play well
return forwardSkill + 25;
}
else {
// Team's forwards do not play well
return forwardSkill - 25;
}
}
// Method that modifies defense skill level
public int changeDefenseSkill(int defenseSkill) {
Random rand = new Random(System.currentTimeMillis());
int fate = rand.nextInt(2);
if (fate == 1) {
// Team's forwards play well
return defenseSkill + 40;
}
else {
// Team's forwards do not play well
return defenseSkill - 40;
}
}
public int changeGoalieSkill(int goalieSkill) {
Random rand = new Random(System.currentTimeMillis());
int fate = rand.nextInt(2);
if (fate == 1) {
// Team's forwards play well
return goalieSkill + 60;
}
else {
// Team's forwards do not play well
return goalieSkill - 60;
}
}
public int regulationScore(int teamSkill) {
Random randGenerator = new Random(System.currentTimeMillis());
int scoreGenerator = teamSkill/50;
int score = randGenerator.nextInt(scoreGenerator+1);
return score;
}
//Name regular time scores R1 and R2
//public void finalScore() {
//Random randPlayer = new Random();
//if (R1 == R2) {
}