-
Notifications
You must be signed in to change notification settings - Fork 0
/
Project2.java
153 lines (140 loc) · 3.34 KB
/
Project2.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
146
147
148
149
150
151
152
153
import java.util.Random;
public class Project{
public static void main (String[] args){
String[] wheelArrayA = {"1", "2", "3", "4", "5"};
String[] wheelArrayB = {"1", "2", "3", "4", "5"};
String[] wheelArrayC = {"1", "2", "3", "4", "5"};
int wheel1result = 9;
int wheel2result = 8;
int wheel3result = 7;
int wheel1prev = 10;
int wheel2prev = 11;
int wheel3prev = 12;
int wheel1next = 13;
int wheel2next = 14;
int wheel3next = 15;
int winpayout = 0;
// remove next line for proper implementation
boolean wheel2lock = false;
int wheel1 = new Random().nextInt(5);
if (wheel1 == 0) {
wheel1result = 0;
}
else if (wheel1 == 1) {
wheel1result = 1;
}
else if (wheel1 == 2) {
wheel1result = 2;
}
else if (wheel1 == 3) {
wheel1result = 3;
}
else if (wheel1 == 4) {
wheel1result = 4;
}
else {
System.out.println("LOSE");
}
int wheel2 = new Random().nextInt(5);
if (wheel2lock == true) {
}
else if (wheel2 == 0) {
wheel2result = 0;
}
else if (wheel2 == 1) {
wheel2result = 1;
}
else if (wheel2 == 2) {
wheel2result = 2;
}
else if (wheel2 == 3) {
wheel2result = 3;
}
else if (wheel2 == 4) {
wheel2result = 4;
}
else {
System.out.println("LOSE");
}
int wheel3 = new Random().nextInt(5);
if (wheel3 == 0) {
wheel3result = 0;
}
else if (wheel3 == 1) {
wheel3result = 1;
}
else if (wheel3 == 2) {
wheel3result = 2;
}
else if (wheel3 == 3) {
wheel3result = 3;
}
else if (wheel3 == 4) {
wheel3result = 4;
}
else {
System.out.println("LOSE");
}
if (wheel1result == 0) {
wheel1prev = 4;
}
else {
wheel1prev = wheel1result - 1;
}
if (wheel2result == 0) {
wheel2prev = 4;
}
else {
wheel2prev = wheel2result - 1;
}
if (wheel3result == 0) {
wheel3prev = 4;
}
else {
wheel3prev = wheel3result - 1;
}
if (wheel1result == 4) {
wheel1next = 0;
}
else {
wheel1next = wheel1result + 1;
}
if (wheel2result == 4) {
wheel2next = 0;
}
else {
wheel2next = wheel2result + 1;
}
if (wheel3result == 4) {
wheel3next = 0;
}
else {
wheel3next = wheel3result + 1;
}
System.out.println("Wheel 1" + "\t" + "Wheel 2" + "\t" + "Wheel 3");
System.out.println(wheel1prev + "\t" + wheel2prev + "\t" + wheel3prev);
System.out.println(wheel1result + "\t" + wheel2result + "\t" + wheel3result);
System.out.println(wheel1next + "\t" + wheel2next + "\t" + wheel3next);
if ((wheel1result == wheel2result) && (wheel2result == wheel3result)) {
System.out.println("YOU WIN ON CENTER MATCH");
winpayout = wheel2result + 1;
}
else if ((wheel1prev == wheel2result) && (wheel2result == wheel3next)) {
System.out.println("YOU WIN ON TOP LEFT DIAGONAL MATCH");
winpayout = wheel2result + 1;
}
else if ((wheel1next == wheel2result) && (wheel2result == wheel3prev)) {
System.out.println("YOU WIN ON BOTTOM LEFT DIAGONAL MATCH");
winpayout = wheel2result + 1;
}
else {
System.out.println("YOU LOSE, NO MATCH");
winpayout = 0;
}
System.out.println(winpayout);
}
}
// URL for scanner help: https://stackoverflow.com/questions/23450524/java-scanner-doesnt-wait-for-user-input
// referenced on May 24, 2017
// URL for if statement help: https://stackoverflow.com/questions/14267220/java-string-for-loop-not-reading-if-statement
// referenced on May 24, 2017