# 4x4 Sliding Puzzle with a twist

For this puzzle, you're given a three piece set as depicted below:

• A blue indicator peg
• A square 4 x 4 tile frame filled with 16 tiles
• A max.8 tile holder / dispenser

Your task is to un-scramble the tiles in the 4x4 frame to form a well-known pictogram.

## There are of course a couple of rules:

• As a first step, you choose a start position. Place the blue peg on one of the light-blue rectangles of the 4x4 frame
• From now on, each of your moves consists of two parts:

• First, perform one action in the row or column indicated by the blue peg
• Then, move the peg one step further in a clockwise rotation
• The actions you can choose from on each move are depicted below.

• Rotate one tile of the active row/column 90 degrees clockwise
• Remove one tile of the active row/column and place it from the top in the dispenser stack. (Do not rotate the tile.)
• Place the bottom most tile from the dispenser stack on an empty tile of the active row/column (Do not rotate the tile.)
• You must not skip an action in a move, i.e. you may never move the blue peg without performing exactly one valid action first.

## Notation

To describe your solution, use the following notation format:

• Specify the starting position as 1 - 16
(1 is the first on the top row, then clockwise)

• Each move:

• Specify the tile as distance from peg, i.e. as @1, @2, @3, or @4
(@1 being adjacent to the peg and @4 furthest away from the peg.)
• Specify the action as either:
• rotate
(from bottom of dispenser)
• remove
(to top of dispenser)

For example:

Start 5
@3: rotate
@1: remove
@2: rotate
...

• Is the no-computers tag only intended to prevent brute-force, or am I also not allowed to make a program for myself just to play it, i.e. for better visualization of each move?
– user14478
Commented Nov 1, 2016 at 16:59
• @LukasRotter Preventing brute-force (initially). I think it can be solved without, but if nobody does in a few days, I'll relax that condition. I just don't want it spoiled immediately. Commented Nov 1, 2016 at 17:00
• BTW, I would recommend putting 16 "tile" images in PowerPoint or similar easy rotate/reassemble program. Commented Nov 1, 2016 at 17:01
• Calling it a stack and having it behave like a queue is a little mean... Commented Nov 1, 2016 at 17:17
• @BmyGuest would it be possible for you to add the 16 'tile' images somewhere so we can easily play with them? If it's too much trouble don't bother, but if it's easy it would be a big help. Commented Nov 1, 2016 at 17:39

So I left my original analysis below, but I think I have found an answer using 34 moves (30 is the bare minimum the puzzle could conceivably be solved in, but I do not know if that is possible or not) Here is my solution as a gif, I can seperate out the images if you wish:

And here is the solution as a move list, I numbered the rows and gave letters to the columns like this:
[A1][B1][C1][D1]
[A2][B2][C2][D2]
[A3][B3][C3][D3]
[A4][B4][C4][D4]

So starting with the dot at the top of column C, the moves are as follows:

1. Remove C4
2. Remove D1
3. Rotate B1
4. Remove A2
5. Remove B3
6. Remove B4
7. Remove D3
8. Remove C2
9. Place B4
10. Rotate A1
11. Place C4
12. Remove A3
13. Remove B2
14. Place D1
15. Place A2
16. Place B2
17. Place C2
18. Rotate D2
19. Rotate A1
20. Rotate A2
21. Place A3
22. Rotate D4
23. Rotate D4
24. Rotate C1
25. Place B3
26. Rotate A3
27. Remove A4
28. Place D3
29. Remove D2
30. Rotate A1
31. Place A4
32. Rotate B1
33. Rotate C1
34. Place D2

My strategy was:

To pick up any piece that needed to be moved and then pick up either the piece that is in the spot it needs to go in or the piece which needs to go in it's now free spot. Otherwise just rotate any tile that needs to be rotated. At the end I needed to do some extra picking up of pieces, because to pick up and replace a piece is only 2 moves, but to rotate it fully is 4, so extra picking up cost less in the long run.

Original analysis below:

So I only just started trying to find an answer, but so far, I have discovered the obvious, which is that the tiles unscramble to

and I did a little bit of analysis on the tiles to see how many moves it would take to get to the final image. R in this case stands for a single 90 degree Rotation clockwise, and M for another 'move' (I.E. if a tile needs to be both picked up and moved to a different location, that is 2 moves) So for each tile the Rotation and Move counts look like this:

The numbers at the end of each row and column are just totals which I thought might be helpful. If you total all the rows or columns you get 30, so the solution has to take at least 30 moves.

also, 9 tiles have to be physically moved, so the best way to go about solving this is probably finding the optimal way to pick up and replace those nine tiles, rotating the other tiles whenever picking up a tile or placing one isn't an option.

• Very good systematic start to the problem. It's analysis like this why I didn't want a PC brute force right away. Commented Nov 1, 2016 at 19:31
• The GIF is great, but could you also give the list of "commands" like in the question asked? (Easier to cross-check and follow up). BTW, 34 is a good solution. My constructed one has 32. I don't know if a 30 move solution exists. I'll wait with the "accept" check for some other answers a bit (~a day) but essentially: Well done! Commented Nov 1, 2016 at 22:49
• @BmyGuest I think if I started in a different place I might be able to get a 32 solution, or someone else might find it before then. I added a command list for the 34 step solution. Commented Nov 2, 2016 at 1:50