Solving and playing the 8-puzzle