Skip to content

Commit 213a72d

Browse files
committed
Maze Solver SbSp: TR Feedback (Final quibbles)
1 parent d4f2a3a commit 213a72d

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

  • python-maze-solver

python-maze-solver/source_code_final/src/maze_solver/models/solution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Solution:
1313
def __post_init__(self) -> None:
1414
assert self.squares[0].role is Role.ENTRANCE
1515
assert self.squares[-1].role is Role.EXIT
16-
reduce(validate_collinear, self.squares)
16+
reduce(validate_corridor, self.squares)
1717

1818
def __iter__(self) -> Iterator[Square]:
1919
return iter(self.squares)
@@ -25,8 +25,8 @@ def __len__(self) -> int:
2525
return len(self.squares)
2626

2727

28-
def validate_collinear(current: Square, following: Square) -> Square:
28+
def validate_corridor(current: Square, following: Square) -> Square:
2929
assert any(
3030
[current.row == following.row, current.column == following.column]
31-
), "Squares must be collinear"
31+
), "Squares must lie in the same row or column"
3232
return following

python-maze-solver/source_code_step_3/src/maze_solver/models/solution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Solution:
1313
def __post_init__(self) -> None:
1414
assert self.squares[0].role is Role.ENTRANCE
1515
assert self.squares[-1].role is Role.EXIT
16-
reduce(validate_collinear, self.squares)
16+
reduce(validate_corridor, self.squares)
1717

1818
def __iter__(self) -> Iterator[Square]:
1919
return iter(self.squares)
@@ -25,8 +25,8 @@ def __len__(self) -> int:
2525
return len(self.squares)
2626

2727

28-
def validate_collinear(current: Square, following: Square) -> Square:
28+
def validate_corridor(current: Square, following: Square) -> Square:
2929
assert any(
3030
[current.row == following.row, current.column == following.column]
31-
), "Squares must be collinear"
31+
), "Squares must lie in the same row or column"
3232
return following

python-maze-solver/source_code_step_4/src/maze_solver/models/solution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Solution:
1313
def __post_init__(self) -> None:
1414
assert self.squares[0].role is Role.ENTRANCE
1515
assert self.squares[-1].role is Role.EXIT
16-
reduce(validate_collinear, self.squares)
16+
reduce(validate_corridor, self.squares)
1717

1818
def __iter__(self) -> Iterator[Square]:
1919
return iter(self.squares)
@@ -25,8 +25,8 @@ def __len__(self) -> int:
2525
return len(self.squares)
2626

2727

28-
def validate_collinear(current: Square, following: Square) -> Square:
28+
def validate_corridor(current: Square, following: Square) -> Square:
2929
assert any(
3030
[current.row == following.row, current.column == following.column]
31-
), "Squares must be collinear"
31+
), "Squares must lie in the same row or column"
3232
return following

python-maze-solver/source_code_step_5/src/maze_solver/models/solution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Solution:
1313
def __post_init__(self) -> None:
1414
assert self.squares[0].role is Role.ENTRANCE
1515
assert self.squares[-1].role is Role.EXIT
16-
reduce(validate_collinear, self.squares)
16+
reduce(validate_corridor, self.squares)
1717

1818
def __iter__(self) -> Iterator[Square]:
1919
return iter(self.squares)
@@ -25,8 +25,8 @@ def __len__(self) -> int:
2525
return len(self.squares)
2626

2727

28-
def validate_collinear(current: Square, following: Square) -> Square:
28+
def validate_corridor(current: Square, following: Square) -> Square:
2929
assert any(
3030
[current.row == following.row, current.column == following.column]
31-
), "Squares must be collinear"
31+
), "Squares must lie in the same row or column"
3232
return following

0 commit comments

Comments
 (0)