Skip to content

Commit ec273f6

Browse files
Create docstring for the new update
1 parent ba688db commit ec273f6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tictactoe/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ def result(self) -> Optional[int]:
166166
return None
167167

168168
def _get_dimension_repr(self, board_partition: npt.NDArray[np.int8]) -> str:
169+
"""
170+
Get a visual representation of a part of the board.
171+
:param board_partition: A part of the board.
172+
:return: A visual representation of a part of the board.
173+
"""
169174
if len(board_partition.shape) > 1:
170175
board_repr = ""
171176
divider = ((board_partition.shape[0] * 4 - 1) * "-" + "\n") * (len(board_partition.shape) - 1)
@@ -183,6 +188,10 @@ def _get_dimension_repr(self, board_partition: npt.NDArray[np.int8]) -> str:
183188
return row
184189

185190
def __repr__(self) -> str:
191+
"""
192+
Get a visual representation of the board.
193+
:return: A visual representation of the board.
194+
"""
186195
return self._get_dimension_repr(self.board)
187196

188197

0 commit comments

Comments
 (0)