Skip to content

Commit

Permalink
Update walker_class.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostan committed Dec 5, 2024
1 parent 46dc1f3 commit 062df10
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion kyu_3/line_safari_is_that_a_line/walker_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,38 @@ def __test_up(self) -> bool:
"""
Test up.
:return:
:return: bool

Check warning on line 215 in kyu_3/line_safari_is_that_a_line/walker_class.py

View check run for this annotation

Codecov / codecov/patch

kyu_3/line_safari_is_that_a_line/walker_class.py#L212-L215

Added lines #L212 - L215 were not covered by tests
"""
row: int = self.__position['row']
col: int = self.__position['col']
return row >= 1 and self.__grid[row - 1][col] in 'X|+'

Check warning on line 219 in kyu_3/line_safari_is_that_a_line/walker_class.py

View check run for this annotation

Codecov / codecov/patch

kyu_3/line_safari_is_that_a_line/walker_class.py#L219

Added line #L219 was not covered by tests

def __test_down(self) -> bool:
"""

Check warning on line 222 in kyu_3/line_safari_is_that_a_line/walker_class.py

View check run for this annotation

Codecov / codecov/patch

kyu_3/line_safari_is_that_a_line/walker_class.py#L222

Added line #L222 was not covered by tests
Test down.
:return: bool
"""
row: int = self.__position['row']
col: int = self.__position['col']
return row + 1 < len(self.__grid) and self.__grid[row + 1][col] in 'X|+'

def __test_left(self) -> bool:
"""
Test left.
:return: bool
"""
row: int = self.__position['row']
col: int = self.__position['col']
return col >= 1 and self.__grid[row][col - 1] in 'X+-'

def __test_right(self) -> bool:
"""
Test right.
:return: bool
"""
row: int = self.__position['row']
col: int = self.__position['col']
return col + 1 < len(self.__grid[row]) and self.__grid[row][col + 1] in 'X+-'

0 comments on commit 062df10

Please sign in to comment.