Skip to content

Commit

Permalink
Edited linear puzzle problem with BFS. 📤
Browse files Browse the repository at this point in the history
  • Loading branch information
RodolfoFerro committed Dec 29, 2018
1 parent 4422707 commit c916acc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions linear_puzzle_bfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def solution_with_bfs(operators, initial_state, solution):
else:
# Generate new children with operators:
children = []
for operator in opertators:
for operator in operators:
child = operator(node)
children.append(child)

Expand All @@ -82,12 +82,12 @@ def solution_with_bfs(operators, initial_state, solution):
initial_state = [1, 4, 3, 2]
solution = [1, 2, 3, 4]

# Define operatos list:
opertators = [left_operator, center_operator,
right_operator, border_operator]
# Define operators list:
operators = [left_operator, center_operator,
right_operator, border_operator]

# Compute solution:
solution_node = solution_with_bfs(opertators, initial_state, solution)
solution_node = solution_with_bfs(operators, initial_state, solution)

# Build steps (by getting the father nodes of the solution):
resulting_path = []
Expand Down

0 comments on commit c916acc

Please sign in to comment.