# Move 2 or 3 spaces in this 5 by 5 grid

You have a 5 by 5 Board as shown.

You start from the S (Center) position.

You can:

1 Move TWO or THREE spaces only

2 You can move Vertically or Horizontally or Diagonally but only in a straight line ( No moves like the Knight in Chess)

3 You must visit all the squares but only ONCE

4 You can jump over (pass thru) any square/s EXCEPT the S (Start) square.

Since the grid is symmetric there will be more than 1 solutions.

BTW : You can have multiple variations of this puzzle where you start from different squares. I found starting from the center most interesting. Also more challenging is limiting only to vertical or horizontal moves. That will get special kudos.

• I presume the 2/3 step movements is horizontal and vertical? And diagonal is 1? Jun 18, 2017 at 22:27
• Nope diagonal can be 2 or 3 also but in a straight line
– DrD
Jun 18, 2017 at 22:34
• NO ONE STEP MOVE IN ANY DIRECTION
– DrD
Jun 18, 2017 at 22:35

## 2 Answers

Let's do the "special kudos" version with no diagonal moves. In this case

if we reorder both rows and columns in the order 25314 then the legal moves are exactly the single orthogonal steps, where we consider the grid to wrap around on all edges. The "no crossing the centre" condition forbids the moves 25,14,42 in the middle row and column.

Now

it is easy to find a solution:

and this one happens not even to need any "wraparound" moves.

which corresponds to

the following path through the original grid, starting with A in the middle and proceeding alphabetically to Y.  I T B J C N Q O M P H S A K D X U W Y V G R F L E

• Darn, that's clever. Jun 19, 2017 at 2:34
• So, what was your reason for reordering and why did it work? Jun 19, 2017 at 13:52
• I noticed that (aside from the funny restriction in the middle) everything has exactly two neighbours horizontally and two vertically, which means they have to form either a loop of length 5 or two loops of 2 and 3; it turns out to be the former. Jun 19, 2017 at 14:13
• And you deserve the Special Kudos Gareth
– DrD
Jun 19, 2017 at 20:51

I randomly encountered this problem and I think I have a simpler solution (for the special kudos version) than Gareth's:

Start by labeling each cell as follows, where the cells with the same label can be stepped over using only size-2 steps: $$\begin{array}{ccccc}A&B&A&B&A\\C&D&C&D&C&\\A&B&A&B&A\\C&D&C&D&C&\\A&B&A&B&A\end{array}$$

Starting from the center cell (which has the label $$A$$), step over all the cells with the same label before moving on to another. This means to start with these moves... $$\begin{array}{ccccc}\bbox[#ccf]{3}&B&\bbox[#ccf]{4}&B&\bbox[#ccf]{5}\\C&D&C&D&C&\\\bbox[#ccf]{2}&B&\bbox[#ccf]{1}&B&\bbox[#ccf]{6}\\C&D&C&D&C&\\\bbox[#ccf]{9}&B&\bbox[#ccf]{8}&B&\bbox[#ccf]{7}\end{array}$$

Then move to $$B$$... $$\begin{array}{ccccc}3&\bbox[#ccf]{13}&4&\bbox[#ccf]{12}&5\\C&D&C&D&C&\\2&\bbox[#ccf]{14}&1&\bbox[#ccf]{11}&6\\C&D&C&D&C&\\9&\bbox[#ccf]{15}&8&\bbox[#ccf]{10}&7\end{array}$$

Then move to $$D$$... $$\begin{array}{ccccc}3&13&4&12&5\\C&\bbox[#ccf]{16}&C&\bbox[#ccf]{17}&C\\2&14&1&11&6\\C&\bbox[#ccf]{19}&C&\bbox[#ccf]{18}&C\\9&15&8&10&7\end{array}$$

Then move to $$C$$, finishing the puzzle. $$\begin{array}{ccccc}3&13&4&12&5\\\bbox[#ccf]{23}&16&\bbox[#ccf]{22}&17&\bbox[#ccf]{21}\\2&14&1&11&6\\\bbox[#ccf]{24}&19&\bbox[#ccf]{25}&18&\bbox[#ccf]{20}\\9&15&8&10&7\end{array}$$

• That seems a good way too.
– DrD
Oct 8, 2020 at 10:46