-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNormalPlayer.java
49 lines (26 loc) · 1.1 KB
/
NormalPlayer.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
public class NormalPlayer extends Player {
public NormalPlayer(int initialMoney) {
super(initialMoney);
}
@Override
public String printPlayer() {
String result = "";
if (count <= 0) {
int result1 = money - record;
System.out.println();
if (result1 > 0) {
System.out.println("---------Congratulations!---------" );
result = "Total money won" + " $" + (result1 - count * initalMoney);
} else if (result1 == 0) {
result = " did not win nor did lose..";
} else {
result1 *= -1;
System.out.println("---------Better Luck next time!!--------- ");
result = "Total money lost " + "$" + (result1 + count * initalMoney);
}
}
System.out.println(" Housemoney" + ": $" + Game.houseMoney);
System.out.println();
return result;
}
}