/
SquareState.py
31 lines (29 loc) · 1.14 KB
/
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
24
25
26
27
28
29
30
31
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|"
@staticmethod
def printSquareMinimal(state):
if state == SquareState.EMPTY: return " "
elif state == SquareState.WHITE: return "o"
elif state == SquareState.WHITEKING: return "O"
elif state == SquareState.BLACK: return "x"
elif state == SquareState.BLACKKING: return "X"