2
$\begingroup$

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?

$\endgroup$

1 Answer 1

2
$\begingroup$

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. enter image description here

$\endgroup$
1
  • $\begingroup$ You got it! Well done. Now try my harder version of this puzzle. $\endgroup$ Commented Apr 16, 2021 at 5:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.