-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMonitorThread.java
30 lines (26 loc) · 1.07 KB
/
MonitorThread.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
// Monitor Thread
public class MonitorThread implements Runnable {
public void run() {
while (true) {
if (MerkleManager.actualMerkleRoot != null) {
if (MerkleManager.actualMerkleRoot.equals(MerkleManager.expectedMerkleRoot)) {
System.out.println("**** YOU WIN **** " + MerkleManager.actualMerkleRoot);
}
else {
System.out.println("**** YOU LOSE **** ");
System.out.println(" You entered: " + MerkleManager.expectedMerkleRoot);
System.out.println("Correct answer is: " + MerkleManager.actualMerkleRoot);
}
System.out.println("\nExiting app...");
System.exit(0);
}
if (MerkleManager.iStrikes == 3) {
System.out.println("*** THREE STRIKES: *** YOU'RE OUT! ***");
System.out.println("\nExiting app...");
System.exit(0);
}
Util util = new Util();
util.sleep(1);
}
}
}