1 | 1 | from .board import ChessBoard |
|
0 ignored issues
–
show
|
|||
2 | |||
3 | class Chess: |
||
0 ignored issues
–
show
This class should have a docstring.
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
def some_method(self):
"""Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions. ![]() |
|||
4 | 1 | ||
5 | def __init__(self, existing_board=None): |
||
6 | 1 | self._board = ChessBoard(existing_board) |
|
7 | 1 | ||
8 | @property |
||
9 | 1 | def board(self): |
|
0 ignored issues
–
show
This method should have a docstring.
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
def some_method(self):
"""Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions. ![]() |
|||
10 | return self._get_board() |
||
11 | 1 | ||
12 | def _get_board(self): |
||
0 ignored issues
–
show
This method should have a docstring.
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
def some_method(self):
"""Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions. ![]() |
|||
13 | 1 | return self._board.board |
|
14 | 1 | ||
15 | def generate_fen(self): |
||
0 ignored issues
–
show
This method should have a docstring.
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
def some_method(self):
"""Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions. ![]() |
|||
16 | 1 | return self._board.generate_fen() |
|
17 | |||
18 | def export(self): |
||
0 ignored issues
–
show
This method should have a docstring.
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
def some_method(self):
"""Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions. ![]() |
|||
19 | 1 | return self._board.export() |
|
20 | |||
21 | def move(self, start_location, end_location): |
||
0 ignored issues
–
show
This method should have a docstring.
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
def some_method(self):
"""Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions. ![]() |
|||
22 | 1 | start = self._convert_location_to_board_indices(start_location) |
|
23 | end = self._convert_location_to_board_indices(end_location) |
||
24 | return self._board.move(start, end) |
||
25 | |||
26 | def destinations(self, start_location): |
||
0 ignored issues
–
show
This method should have a docstring.
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
def some_method(self):
"""Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions. ![]() |
|||
27 | 1 | return self._board.end_locations_for_piece_at_location(start_location) |
|
28 | |||
29 | @staticmethod |
||
30 | 1 | def _convert_location_to_board_indices(location): |
|
0 ignored issues
–
show
This method should have a docstring.
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
def some_method(self):
"""Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions. ![]() |
|||
31 | if isinstance(location, str): |
||
32 | assert len(location) == 2 |
||
33 | alphabet = "abcdefghijklmnopqrstuvwxyz" |
||
34 | col = alphabet.index(location[0].lower()) |
||
35 | row = int(location[1]) - 1 |
||
36 | key = (row, col) |
||
37 | return key |
||
38 | return location |
||
39 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.