# Snake game on a 6×6 grid

You are playing a snake game. The snake starts in the top-left corner of a grid. Each cell of the grid is either empty or a wall. Each turn you can press a key to move the snake in one of four directions: either horizontally or vertically. Once a key is pressed, the snake moves in the assigned direction until it either reaches a wall or the boundary of the grid. Can you construct a $$6 \times 6$$ grid with $$2$$ walls such that the snake is able to visit every empty cell of the grid?

## 1 Answer

Put the walls in the 3rd row of the rightmost column and the 4th row of the leftmost column. Then move Right, Down, Left, Down, Right, Down, Left, Up, Right, Up, Left, Down, Right.

• You got it! Well done. Now try my harder version of this puzzle. Apr 16 at 5:08