Code to solve and analise the snake puzzle