Skip to content

Commit

Permalink
Output only one solution
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellDash332 committed Nov 13, 2024
1 parent a74ae2a commit 9d97d07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pancake/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def heuristic(state, swaps):
vis.add(check), heappush(q, (heuristic(u, d), u.copy(), d+1, path + ((i, j),)))
u[i], u[j] = u[j], u[i] # revert swap
if best[0]: ret.append(best[0])
return '\n'.join(ret)
return '\n'.join(sorted(ret)[-1:])

class DeluxePancake(Pancake):
def __init__(self, board=None, verdict=None, wordlist='data/deluxe.txt', name='deluxepancake'):
Expand Down

0 comments on commit 9d97d07

Please sign in to comment.