public
class
Scoring {
public
final
static
int
MAX =
100
;
public
final
static
int
EMPTY =
0
;
static
int
stack[] =
new
int
[MAX];
static
int
top =
0
;
public
static
int
_1p =
0
;
public
static
int
_2p =
0
;
public
static
String p1Score =
"0"
;
public
static
String p2Score =
"0"
;
public
static
int
p1Game =
0
;
public
static
int
p2Game =
0
;
static
int
Win =
0
;
static
boolean
tieBreak =
false
;
static
void
ruleMain(
int
buttonClick)
{
if
(buttonClick==
3
){
int
popRet;
popRet = Pop();
if
(popRet==
1
){
_1p--;
if
(_1p<
0
){
_1p =
0
;
}
System.out.println(
"1p :"
+_1p);
WinSearch();
}
else
if
(popRet==
2
){
_2p--;
if
(_2p<
0
){
_2p =
0
;
}
System.out.println(
"2p :"
+_2p);
WinSearch();
}
}
static
void
Push(
int
data){
int
push;
if
(!isFull()){
push = stack[++top] = data;
System.out.println(push);
}
else
{
System.out.println(
"Stack Error"
);
}
}
static
int
Pop() {
int
ret =
1
;
if
(!isEmpty())
ret = stack[--top];
System.out.println(ret);
return
ret;
}
static
Boolean isEmpty() {
if
(top == EMPTY)
return
true
;
return
false
;
}
static
Boolean isFull() {
if
(top == MAX-
1
)
return
true
;
return
false
;
}
}