forked from UWOneLaptop/Checkers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SquareState.py
23 lines (22 loc) · 886 Bytes
/
SquareState.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class SquareState:
EMPTY=0
WHITE=1
WHITEKING=2
BLACK=3
BLACKKING=4
"""
This method is used for printing the board in ascii. It is only useful until the GUI is built
Remove for production
"""
@staticmethod
def printSquare(state, isWhite):
if state == SquareState.EMPTY and isWhite: return " "
elif state == SquareState.EMPTY and not isWhite: return "|||"
elif state == SquareState.WHITE and isWhite: return " O "
elif state == SquareState.WHITE and not isWhite: return "|O|"
elif state == SquareState.WHITEKING and isWhite: return " 0 "
elif state == SquareState.WHITEKING and not isWhite: return "|0|"
elif state == SquareState.BLACK and isWhite: return " X "
elif state == SquareState.BLACK and not isWhite: return "|X|"
elif state == SquareState.BLACKKING and isWhite: return " K "
elif state == SquareState.BLACKKING and not isWhite: return "|K|"