Code to solve and analise "snake" puzzles