-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpieces.py
More file actions
104 lines (76 loc) · 2.22 KB
/
pieces.py
File metadata and controls
104 lines (76 loc) · 2.22 KB
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
from __future__ import annotations
class Piece:
def __init__(self: Piece) -> None:
self.coordinates: tuple[int, int] = (0, 0)
self.symbol = '| P '
self.colour = bool(0)
self.type = 'P'
# The Whites
class Pawn (Piece):
def __init__(self: Pawn) -> None:
# General pawn rules
self.symbol = '| ♙ '
self.colour = 0
self.type = 'WhitePawn'
class Rook (Piece):
def __init__(self: Rook) -> None:
# General Rook rules
self.symbol = '| ♖ '
self.colour = 0
self.type = 'Rook'
class Knight (Piece):
def __init__(self: Knight) -> None:
# General Knight rules
self.symbol = '| ♘ '
self.colour = 0
self.type = 'Knight'
class Bishop (Piece):
def __init__(self: Bishop) -> None:
# General Bishop rules
self.symbol = '| ♗ '
self.colour = 0
self.type = 'Bishop'
class King (Piece):
def __init__(self: King) -> None:
# General King rules
self.symbol = '| ♔ '
self.colour = 0
self.type = 'King'
class Queen (Piece):
def __init__(self: Queen) -> None:
# General Queen rules
self.symbol = '| ♕ '
self.colour = 0
self.type = 'Queen'
# The Blacks
class PawnBlack (Pawn):
def __init__(self: PawnBlack) -> None:
# Reverse direction
self.symbol = '| ♟ '
self.colour = 1
self.type = 'BlackPawn'
class RookBlack (Rook):
def __init__(self: RookBlack) -> None:
self.symbol = '| ♜ '
self.colour = 1
self.type = 'Rook'
class KnightBlack (Knight):
def __init__(self: KnightBlack) -> None:
self.symbol = '| ♞ '
self.colour = 1
self.type = 'Knight'
class BishopBlack (Bishop):
def __init__(self: BishopBlack) -> None:
self.symbol = '| ♝ '
self.colour = 1
self.type = 'Bishop'
class KingBlack (King):
def __init__(self: KingBlack) -> None:
self.symbol = '| ♚ '
self.colour = 1
self.type = 'King'
class QueenBlack (Queen):
def __init__(self: QueenBlack) -> None:
self.symbol = '| ♛ '
self.colour = 1
self.type = 'Queen'