fix typos

This commit is contained in:
Jakub Kliszko 2023-03-22 11:42:47 +01:00
parent 9242930433
commit 057197ee38

View File

@ -59,7 +59,7 @@ class MazeSolver:
# If it is not a "wall" (#) add its position to list of neighbors # If it is not a "wall" (#) add its position to list of neighbors
def get_neighbors(self, position): def get_neighbors(self, position):
'''Finds point's neighbours''' '''Finds point's neighbors'''
row, col = position row, col = position
neighbors = [] neighbors = []
if row > 0 and self.maze[row - 1][col] != '#': if row > 0 and self.maze[row - 1][col] != '#':
@ -89,7 +89,7 @@ class MazeSolver:
self.start])) self.start]))
# Go through queue until it's empty # Go through queue until it's empty
# Find neighbor (which is not wall) closests to the # Find neighbor (which is not wall) closest to the
# END point (based on heuristic) # END point (based on heuristic)
# Go there and repeat # Go there and repeat
# if cannot find path it starts over but skips the path that lead it to # if cannot find path it starts over but skips the path that lead it to
@ -161,7 +161,7 @@ def print_maze(maze, path=None):
# Ran first in the code # Ran first in the code
if __name__ == '__main__': if __name__ == '__main__':
print (sys.argv) print(sys.argv)
file_name = 'maze.txt' file_name = 'maze.txt'
if len(sys.argv) > 1: if len(sys.argv) > 1:
file_name = sys.argv[1] file_name = sys.argv[1]