Skip to content

Instantly share code, notes, and snippets.

@joshuakenzo
joshuakenzo / slidingpuzzle.py
Created October 16, 2011 17:24
A* sliding puzzle solver
# -*- coding: utf-8 -*-
"""
Solver script for the fifteen-puzzle and derivations of it (8-puzzle etc.),
based on what we've learnt on ai-class.com so far. Don't expect it to run very
fast, certain puzzle states take ages to solve. I have documented and
commented the code thoroughly, so hopefully it's easy to understand what's
going on.
Written by Håvard Pettersson. Released into the public domain.