Javascript implementation of an algorithm that plays the mobile game "ruzzle"