The Puzzle 8 is a variant of 15 ( Fifteen ). Fifteen is a slider puzzle, also a matlab function, with the goal being to create the matrix [1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 0] where 0 is a hole.
Given a matrix m [3,3] and a matrix vset [n,k] of n possible solutions of up to length k determine which solution is valid. Return a vector [1,k] that produces [1 2 3;4 5 6;7 8 0]
Movement is of the Zero-0. 3-Up, 0-Down, 1-Left, 2-Right, 4 is Not used/SKIP
Some potential solutions may cause faults so try/catch may be required
The deepest solutions of 8 is 31 single moves. Solving this will be the next 8 challenge.
[867;254;301] and [647;850;321] have 29 solutions each of length 31
The Puzzle 8 cases are readily created using a 15 board.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers4
Suggested Problems
-
Return the 3n+1 sequence for n
8487 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1989 Solvers
-
Find perfect placement of non-rotating dominoes (easier)
381 Solvers
-
379 Solvers
-
Golomb's self-describing sequence (based on Euler 341)
181 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!