# 9 digits in vertical arrangement

Here, 9 digits are given vertically on a board with 4 wings: North, West, South, East.

Your mission is to arrange them horizontally.

Pieces can move any distance in a move.

The first move is clearly to move the digit 7 to the west wing. We can denote it by 7W.

Note that 7W means “to move digit to the West wing” not “to move to the direction of west.”

• How are you making these beautiful graphics? Commented Aug 14, 2023 at 22:32
• @SlowMagic LaTeX + TikZ Commented Aug 15, 2023 at 1:20

I have found solution with only

25 moves (consecutive movements of 1 tile is 1 move)
42 moves (every move is counted separately)

Here an animation of the idea:

And for completeness, all steps taken:

25 moves:
7W 6E 5E 4W 5W 6W 8W 3S 2E 1E 8N 6N 5N 4N 7N 1W 2W 3W 9E 7S 4W 5W 6W 8E 7N

42 moves:
7W 6S 6E 5S 5E 4S 4W 5W 6W 8N 8W 3S 2S 2E 1S 1E 8E 8N 6E 6N 5E 5N 4E 4N 7E 7N 1W 2W 3N 3W 9N 9E 7S 4S 4W 5S 5W 6S 6W 8S 8E 7N

• If all consecutive movements of a single tile are considered 1 move, which apparently is the intention of the OP, then this is 26 moves, the same as ACB's solution. Commented Aug 7, 2023 at 17:44
• @JaapScherphuis, I know, but I already had this solution, before OP clarified how it should be counted. I was halfway of making this animation before he typed it in the chat, and it is still more efficient than the other answer. That's why I did post it anyway. Commented Aug 7, 2023 at 18:07
• Sorry, it wasn't meant as a complaint, just as added info. I really like your animation. Commented Aug 7, 2023 at 18:33
• @JaapScherphuis, If I count correctly, I come up with 25 moves :) I agreed with you initially, but we both counted wrong ;) Commented Aug 7, 2023 at 19:21
• I've just run a breadth first search on my computer, and if I did that right 25 moves is the shortest solution. Furthermore, there are no positions further than 25 moves away from the starting position so the the goal position is antipodal (though there are many other antipodes). Commented Aug 8, 2023 at 15:29

We can do it in

26 moves, if we count consecutive movements of 1 tile as 1 move
(ex:- 8 North + 8 East = 8 to East wing = 1 move)
or
43 moves, if we count based on the directions in which a tile is going.
(ex:- 8 North + 8 East = 2 moves)

Using the suggested notation

26 moves

 7W 8W 9W 6W 5W 4S 3S 2E 1E 5N 6N 9N 8N
7N 1W 2W 3W 4W 7S 8S 9E 8E 6S 5W 6W 7O

43 moves

 7W 8N 8W 9N 9W 6S 6W 5S 5W 4S 3S
2S 2E 1S 1E 5E 5N 6E 6N 9E 9N 8E
8N 7E 7N 1W 2W 3N 3W 4N 4W 7S 8S
9S 9E 8N 8E 6S 5S 5W 6N 6W 7N

Or, if the notation is confusing you,

• Great animation. Makes a potentially tricky process really simple to follow!
– Stiv
Commented Aug 6, 2023 at 12:41
• Good! But, it can be solved in less moves. Commented Aug 6, 2023 at 22:05
• Yo the animation slaps Commented Aug 7, 2023 at 9:51
• @P.-S.Park I am not seeing a better method right now. Let's see if any other can come up with that. I am also trying to find it.
– ACB
Commented Aug 7, 2023 at 11:54
• @P.-S.Park is it 26 then?
– ACB
Commented Aug 7, 2023 at 16:29