class ChessPiece:
"""Represents a piece in the abstract board game variant of chess."""
def __init__(self, name, x_pos, y_pos):
"""Initializes a piece in the abstract board game variant of chess."""
self._name = name
self._x_pos = x_pos
self._y_pos = y_pos
def get_name(self):
"""Returns the name of a piece."""
return self._name
def get_position(self):
"""Returns the position of a piece."""
return self._x_pos, self._y_pos
P1 = ChessPiece("White Pawn 1", "a", "2")
P2 = ChessPiece("White Pawn 2", "b", "2")
P3 = ChessPiece("White Pawn 3", "c", "2")
P4 = ChessPiece("White Pawn 4", "d", "2")
P5 = ChessPiece("White Pawn 5", "e", "2")
P6 = ChessPiece("White Pawn 6", "f", "2")
P7 = ChessPiece("White Pawn 7", "g", "2")
P8 = ChessPiece("White Pawn 8", "h", "2")
R1 = ChessPiece("White Rook 1", "a", "1")
R2 = ChessPiece("White Rook 2", "h", "1")
K1 = ChessPiece("White Knight 1", "b", "1")
K2 = ChessPiece("White Knight 2", "g", "1")
B1 = ChessPiece("White Bishop 1", "c", "1")
B2 = ChessPiece("White Bishop 1", "f", "1")
K = ChessPiece("White King 1", "d", "1")
Q = ChessPiece("White Queen 1", "e", "1")
piece_list = [B1, B2, K, K1, K2, P1, P2, P3, P4, P5, P6, P7, P8, R1, R2, Q]
print(K.get_position())
print(get_piece_in_position())
print_board()