-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
145 lines (115 loc) · 3.93 KB
/
Main.java
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner input;
int numDays = 0;
int numStress = -1;
int numFreq = -1;
int cscDays = 0;
double eventRoll;
int days = 0;
int examDiff = 3; // Default difficulty
long examTime = 60; // Default time
// Exam values
System.out.println("Welcome to Minds & Matter!");
System.out.print("Please input amount of days: "); // Default 20
System.out.println();
input = new Scanner(System.in);
// Put a try-catch here later
try{
numDays = input.nextInt();
if (numDays <=0) throw new Exception();
}
catch(Exception e){
while(numDays <= 0){
try{
numDays = input.nextInt();
if (numDays <=0) throw new Exception();
}
catch(Exception m){
System.out.println("Incorrect input. Please input amount of days: ");
input = new Scanner(System.in);
}
}
}
// System.out.println("Your days is " + numDays);
System.out.print("Please input amount of initial stress. Max = 100"); // Default 0
System.out.println();
input = new Scanner(System.in);
// Put a try-catch here later
try{
numStress = input.nextInt();
if (numStress < 0) throw new Exception();
}
catch(Exception f){
while(numStress < 0){
try{
numStress = input.nextInt();
if(numStress < 0) throw new Exception();
}
catch(Exception n){
System.out.println("Please enter a number >= 0: ");
input = new Scanner(System.in);
}
}
}
// System.out.println("Your stress is " + numStress);
System.out.print("Please input how often tests occur. Default: 7");
System.out.println();
input = new Scanner(System.in);
// Put a try-catch here later
try{
numFreq = input.nextInt();
if(numFreq < 0) throw new Exception();
}
catch(Exception a){
while(numFreq < 0){
try{
numFreq = input.nextInt();
if(numFreq < 0) throw new Exception();
}
catch(Exception n){
System.out.println("Please enter a number >= 0: ");
input = new Scanner(System.in);
}
}
}
input.close();
// Main program
do{
if(numStress >= 100) break;
days += 1;
System.out.println("Day " + days + ". Your stress is " + numStress + ".");
eventRoll = Math.random();
// High Stress Mode
if(numStress >= 70){
System.out.println("You are in High Stress mode. Bad events are more likely to occur.");
cscDays ++;
// Check for consecutive days of High Stress
if (cscDays >=2){
System.out.println("CAUTION: You have been in High Stress for " + cscDays + "days. Good events are disabled.");
System.out.println("The chance of a bad event has been increased by " + 5*cscDays + ".");
}
// Roll for event
// Test takes the ENTIRE day if it's test day. Skip over choices if this happens
// Present choices
}
// Low Stress
else{
// Roll for event
// Test takes the ENTIRE day if it's test day. Skip over choices if this happens
// Present choices
}
}
while(days < numDays);
if(numStress >= 100 && days == 0){
System.out.println("You haven't even started the game and yet you already lost. You lose!");
}
else if(numStress >= 100 && days > 0 && days != numDays){
System.out.println("You can't seem to find a way to manage your stress levels. You burn out, losing your motivation and your sense of time. By the time you recover, you have failed the year.");
}
else{
System.out.println("Despite the turbulent year, you manage to keep your stress levels low enough to get through your exams. You pass your classes and welcome a well-deserved break. You win!");
}
}
}