15 puzzle solver: Difference between revisions

m
(Added Go)
m (→‎{{header|Wren}}: Minor tidy)
(125 intermediate revisions by 28 users not shown)
Line 36:
* [[A* search algorithm]]
<br><br>
=={{header|11l}}==
{{trans|Nim}}
 
<syntaxhighlight lang="11l">-V
=={{header|C++}}==
nr = [3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3]
===Staying Functional (as possible in C++)===
nc = [3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2]
====The Solver====
 
{{trans|FSharp}}
T Solver
<lang cpp>
n = 0
// Solve Random 15 Puzzles : Nigel Galloway - October 11th., 2017
np = 0
const int Nr[]{3,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3}, Nc[]{3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2};
n0 = [0] * 100
using N = std::tuple<int,int,unsigned long,std::string,int>;
n2 = [UInt64(0)] * 100
void fN(const N,const int);
n3 = [Char("\0")] * 100
const N fI(const N n){
n4 = [0] * 100
int g = (11-std::get<1>(n)-std::get<0>(n)*4)*4;
 
unsigned long a = std::get<2>(n)&((unsigned long)15<<g);
F (values)
return N (std::get<0>(n)+1,std::get<1>(n),std::get<2>(n)-a+(a<<16),std::get<3>(n)+"d",(Nr[a>>g]<=std::get<0>(n))?std::get<4>(n):std::get<4>(n)+1);
.n0[0] = values.index(0)
}
 
const N fG(const N n){
UInt64 tmp = 0
int g = (19-std::get<1>(n)-std::get<0>(n)*4)*4;
L(val) values
unsigned long a = std::get<2>(n)&((unsigned long)15<<g);
tmp = (tmp << 4) [|] val
return N (std::get<0>(n)-1,std::get<1>(n),std::get<2>(n)-a+(a>>16),std::get<3>(n)+"u",(Nr[a>>g]>=std::get<0>(n))?std::get<4>(n):std::get<4>(n)+1);
.n2[0] = tmp
}
 
const N fE(const N n){
F fI()
int g = (14-std::get<1>(n)-std::get<0>(n)*4)*4;
V n = .n
unsigned long a = std::get<2>(n)&((unsigned long)15<<g);
V g = (11 - .n0[n]) * 4
return N (std::get<0>(n),std::get<1>(n)+1,std::get<2>(n)-a+(a<<4),std::get<3>(n)+"r",(Nc[a>>g]<=std::get<1>(n))?std::get<4>(n):std::get<4>(n)+1);
V a = .n2[n] [&] (UInt64(15) << g)
}
.n0[n + 1] = .n0[n] + 4
const N fL(const N n){
int .n2[n + 1] = .n2[n] - a g+ =(a (16-std::get<1>(n)-std::get<0>(n)*4 16)*4;
.n3[n + 1] = Char(‘d’)
unsigned long a = std::get<2>(n)&((unsigned long)15<<g);
.n4[n + 1] = .n4[n] + Int(:nr[Int(a >> g)] > .n0[n] I/ 4)
return N (std::get<0>(n),std::get<1>(n)-1,std::get<2>(n)-a+(a>>4),std::get<3>(n)+"l",(Nc[a>>g]>=std::get<1>(n))?std::get<4>(n):std::get<4>(n)+1);
 
F fG()
V n = .n
V g = (19 - .n0[n]) * 4
V a = .n2[n] [&] (UInt64(15) << g)
.n0[n + 1] = .n0[n] - 4
.n2[n + 1] = .n2[n] - a + (a >> 16)
.n3[n + 1] = Char(‘u’)
.n4[n + 1] = .n4[n] + Int(:nr[Int(a >> g)] < .n0[n] I/ 4)
 
F fE()
V n = .n
V g = (14 - .n0[n]) * 4
V a = .n2[n] [&] (UInt64(15) << g)
.n0[n + 1] = .n0[n] + 1
.n2[n + 1] = .n2[n] - a + (a << 4)
.n3[n + 1] = Char(‘r’)
.n4[n + 1] = .n4[n] + Int(:nc[Int(a >> g)] > .n0[n] % 4)
 
F fL()
V n = .n
V g = (16 - .n0[n]) * 4
V a = .n2[n] [&] (UInt64(15) << g)
.n0[n + 1] = .n0[n] - 1
.n2[n + 1] = .n2[n] - a + (a >> 4)
.n3[n + 1] = Char(‘l’)
.n4[n + 1] = .n4[n] + Int(:nc[Int(a >> g)] < .n0[n] % 4)
 
F fY()
I .n2[.n] == 1234'5678'9ABC'DEF0
R 1B
I .n4[.n] <= .np
R .fN()
R 0B
 
F fN() -> Bool
V n = .n
I .n3[n] != ‘u’ & .n0[n] I/ 4 < 3 {.fI(); .n++; I .fY() {R 1B}; .n--}
I .n3[n] != ‘d’ & .n0[n] I/ 4 > 0 {.fG(); .n++; I .fY() {R 1B}; .n--}
I .n3[n] != ‘l’ & .n0[n] % 4 < 3 {.fE(); .n++; I .fY() {R 1B}; .n--}
I .n3[n] != ‘r’ & .n0[n] % 4 > 0 {.fL(); .n++; I .fY() {R 1B}; .n--}
R 0B
 
F run()
L !.fY()
.np++
print(‘Solution found with ’(.n)‘ moves: ’, end' ‘’)
L(g) 1 .. .n
print(.n3[g], end' ‘’)
print(‘.’)
 
V solver = Solver([15, 14, 1, 6,
9, 11, 4, 12,
0, 10, 7, 3,
13, 8, 5, 2])
solver.run()</syntaxhighlight>
 
{{out}}
<pre>
Solution found with 52 moves: rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd.
</pre>
 
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
<syntaxhighlight lang="aarch64 assembly">
/* ARM assembly AARCH64 Raspberry PI 3B */
/* program puzzle15solvex64.s */
/* this program is a adaptation algorithme C++ and go rosetta code */
/* thanck for the creators */
/* 1 byte by box on game board */
 
/* create a file with nano */
/* 15, 2, 3, 4
5, 6, 7, 1
9, 10, 8, 11
13, 14, 12, 0 */
/* Run this programm : puzzle15solver64 <file name> */
/* wait several minutes for résult */
 
/*******************************************/
/* Constantes file */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstantesARM64.inc"
 
.equ TRUE, 1
.equ FALSE, 0
 
.equ SIZE, 4
.equ NBBOX, SIZE * SIZE
.equ TAILLEBUFFER, 100
.equ NBMAXIELEMENTS, 100
 
.equ CONST_I, 1
.equ CONST_G, 8
.equ CONST_E, 2
.equ CONST_L, 4
 
/*********************************/
/* Initialized data */
/*********************************/
.data
szMessTitre: .asciz "File name : "
sMessResult: .ascii " "
sMessValeur: .fill 22, 1, ' ' // size => 21
szCarriageReturn: .asciz "\n"
szMessCounterSolution: .asciz "Solution in @ moves : \n"
 
szMessErreur: .asciz "Error detected.\n"
szMessImpossible: .asciz "!!! Impossible solution !!!\n"
szMessErrBuffer: .asciz "buffer size too less !!"
szMessSpaces: .asciz " "
 
qTabNr: .quad 3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3
qTabNc: .quad 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2
/*********************************/
/* UnInitialized data */
/*********************************/
.bss
.align 8
sZoneConv: .skip 24
qAdrHeap: .skip 8
tbBox: .skip SIZE * SIZE // game boxes
qAdrFicName: .skip 8
qTabN0: .skip 8 * NBMAXIELEMENTS // empty box
qTabN3: .skip 8 * NBMAXIELEMENTS // moves
qTabN4: .skip 8 * NBMAXIELEMENTS // ????
qTabN2: .skip 8 * NBMAXIELEMENTS // table game address
sBuffer: .skip TAILLEBUFFER
/*********************************/
/* code section */
/*********************************/
.text
.global main
main: // INFO: main
mov x0,sp // stack address for load parameter
bl traitFic // read file and store value in array
cmp x0,#-1
beq 100f // error ?
 
ldr x0,qAdrtbBox
bl displayGame // display array game
ldr x0,qAdrtbBox // control if solution exists
bl controlSolution
cmp x0,#TRUE
beq 1f
ldr x0,qAdrszMessImpossible // no solution !!!
bl affichageMess
b 100f
 
1:
ldr x0,qAdrtbBox
ldr x9,qAdrqTabN2
str x0,[x9] // N2 address global
mov x10,#0 // variable _n global
mov x12,#0 // variable n global
bl searchSolution
cmp x0,#TRUE
bne 100f // no solution ?
ldr x3,qAdrqTabN2
ldr x0,[x3,x12,lsl #3] // visual solution control
bl displayGame
mov x0,x12 // move counter
ldr x1,qAdrsZoneConv
bl conversion10 // conversion counter
ldr x0,qAdrszMessCounterSolution
bl strInsertAtCharInc
ldr x1,qAdrsZoneConv
bl affichageMess
ldr x5,qAdrqTabN3
ldr x3,qAdrsBuffer
mov x2,#1
mov x4,#0
2: // loop solution display
ldr x1,[x5,x2,lsl 3]
cmp x2,#TAILLEBUFFER
bge 99f
strb w1,[x3,x4]
add x4,x4,#1
add x2,x2,#1
cmp x2,x12
ble 2b
mov x1,#0
strb w1,[x3,x4] // zéro final
mov x0,x3
bl affichageMess
ldr x0,qAdrszCarriageReturn
bl affichageMess
b 100f
 
99:
ldr x0,qAdrszMessErrBuffer
bl affichageMess
100: // standard end of the program
mov x0, #0 // return code
mov x8, #EXIT // request to exit program
svc #0 // perform the system call
qAdrtbBox: .quad tbBox
qAdrqTabN0: .quad qTabN0
qAdrqTabN2: .quad qTabN2
qAdrqTabN3: .quad qTabN3
qAdrqTabN4: .quad qTabN4
qAdrszMessCounterSolution: .quad szMessCounterSolution
qAdrszMessImpossible: .quad szMessImpossible
qAdrszMessErrBuffer: .quad szMessErrBuffer
qAdrsZoneConv: .quad sZoneConv
/******************************************************************/
/* search Solution */
/******************************************************************/
searchSolution: // INFO: searchSolution
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
stp x6,x7,[sp,-16]! // save registres
stp x8,x9,[sp,-16]! // save registres
// address allocation place on the heap
mov x0,#0 // allocation place heap
mov x8,BRK // call system 'brk'
svc #0
cmp x0,#-1 // allocation error
beq 99f
ldr x1,qAdrqAdrHeap
str x0,[x1] // store heap address
bl functionFN
ldr x3,qAdrqTabN2
ldr x0,[x3,x12,lsl #3] // last current game
bl gameOK // it is Ok ?
cmp x0,#TRUE
beq 100f // yes --> end
 
ldr x1,qAdrqAdrHeap // free up resources
ldr x0,[x1] // restaur start address heap
mov x8,BRK // call system 'brk'
svc #0
cmp x0,#-1 // allocation error
beq 99f
add x10,x10,#1 // _n
mov x12,#0 // n
bl searchSolution // next recursif call
b 100f
99:
ldr x0,qAdrszMessErreur
bl affichageMess
100:
ldp x8,x9,[sp],16 // restaur des 2 registres
ldp x6,x7,[sp],16 // restaur des 2 registres
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
qAdrszMessErreur: .quad szMessErreur
qAdrqAdrHeap: .quad qAdrHeap
/******************************************************************/
/* Fonction FN */
/******************************************************************/
functionFN: // INFO: functionFN
stp x1,lr,[sp,-16]! // save registres
ldr x4,qAdrqTabN3
ldr x3,[x4,x12,lsl #3]
ldr x5,qAdrqTabN0 // load position empty box
ldr x6,[x5,x12,lsl #3]
cmp x6,#15 // last box
bne 2f
cmp x3,#'R'
bne 11f
mov x0,#CONST_G
bl functionFZ
b 100f
11:
cmp x3,#'D'
bne 12f
mov x0,#CONST_L
bl functionFZ
b 100f
12:
mov x0,#CONST_G + CONST_L
bl functionFZ
b 100f
2:
cmp x6,#12
bne 3f
cmp x3,#'L'
bne 21f
mov x0,#CONST_G
bl functionFZ
b 100f
21:
cmp x3,#'D'
bne 22f
mov x0,#CONST_E
bl functionFZ
b 100f
22:
mov x0,#CONST_E + CONST_G
bl functionFZ
b 100f
3:
cmp x6,#13
beq 30f
cmp x6,#14
bne 4f
30:
cmp x3,#'L'
bne 31f
mov x0,#CONST_G + CONST_L
bl functionFZ
b 100f
31:
cmp x3,#'R'
bne 32f
mov x0,#CONST_G + CONST_E
bl functionFZ
b 100f
32:
cmp x3,#'D'
bne 33f
mov x0,#CONST_E + CONST_L
bl functionFZ
b 100f
33:
mov x0,#CONST_L + CONST_E + CONST_G
bl functionFZ
b 100f
4:
cmp x6,#3
bne 5f
cmp x3,#'R'
bne 41f
mov x0,#CONST_I
bl functionFZ
b 100f
41:
cmp x3,#'U'
bne 42f
mov x0,#CONST_L
bl functionFZ
b 100f
42:
mov x0,#CONST_I + CONST_L
bl functionFZ
b 100f
5:
cmp x6,#0
bne 6f
cmp x3,#'L'
bne 51f
mov x0,#CONST_I
bl functionFZ
b 100f
51:
cmp x3,#'U'
bne 52f
mov x0,#CONST_E
bl functionFZ
b 100f
52:
mov x0,#CONST_I + CONST_E
bl functionFZ
b 100f
6:
cmp x6,#1
beq 60f
cmp x6,#2
bne 7f
60:
cmp x3,#'L'
bne 61f
mov x0,#CONST_I + CONST_L
bl functionFZ
b 100f
61:
cmp x3,#'R'
bne 62f
mov x0,#CONST_E + CONST_I
bl functionFZ
b 100f
62:
cmp x3,#'U'
bne 63f
mov x0,#CONST_E + CONST_L
bl functionFZ
b 100f
63:
mov x0,#CONST_I + CONST_E + CONST_L
bl functionFZ
b 100f
7:
cmp x6,#7
beq 70f
cmp x6,#11
bne 8f
70:
cmp x3,#'R'
bne 71f
mov x0,#CONST_I + CONST_G
bl functionFZ
b 100f
71:
cmp x3,#'U'
bne 72f
mov x0,#CONST_G + CONST_L
bl functionFZ
b 100f
72:
cmp x3,#'D'
bne 73f
mov x0,#CONST_I + CONST_L
bl functionFZ
b 100f
73:
mov x0,#CONST_I + CONST_G + CONST_L
bl functionFZ
b 100f
8:
cmp x6,#4
beq 80f
cmp x6,#8
bne 9f
80:
cmp x3,#'D'
bne 81f
mov x0,#CONST_I + CONST_E
bl functionFZ
b 100f
81:
cmp x3,#'U'
bne 82f
mov x0,#CONST_G + CONST_E
bl functionFZ
b 100f
82:
cmp x3,#'L'
bne 83f
mov x0,#CONST_I + CONST_G
bl functionFZ
b 100f
83:
mov x0,#CONST_G + CONST_E + CONST_I
bl functionFZ
b 100f
9:
cmp x3,#'D'
bne 91f
mov x0,#CONST_I + CONST_E + CONST_L
bl functionFZ
b 100f
91:
cmp x3,#'L'
bne 92f
mov x0,#CONST_I + CONST_G + CONST_L
bl functionFZ
b 100f
92:
cmp x3,#'R'
bne 93f
mov x0,#CONST_I + CONST_G + CONST_E
bl functionFZ
b 100f
93:
cmp x3,#'U'
bne 94f
mov x0,#CONST_G + CONST_E + CONST_L
bl functionFZ
b 100f
94:
mov x0,#CONST_G + CONST_L + CONST_I + CONST_E
bl functionFZ
b 100f
 
99: // error
ldr x0,qAdrszMessErreur
bl affichageMess
100:
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
 
/******************************************************************/
/* function FZ */
/* */
/***************************************************************/
/* x0 contains variable w */
functionFZ: // INFO: functionFZ
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
mov x2,x0
and x1,x2,#CONST_I
cmp x1,#0
ble 1f
bl functionFI
bl functionFY
cmp x0,#TRUE
beq 100f
sub x12,x12,#1 // variable n
1:
ands x1,x2,#CONST_G
ble 2f
bl functionFG
bl functionFY
cmp x0,#TRUE
beq 100f
sub x12,x12,#1 // variable n
2:
ands x1,x2,#CONST_E
ble 3f
bl functionFE
bl functionFY
cmp x0,#TRUE
beq 100f
sub x12,x12,#1 // variable n
3:
ands x1,x2,#CONST_L
ble 4f
bl functionFL
bl functionFY
cmp x0,#TRUE
beq 100f
sub x12,x12,#1 // variable n
4:
mov x0,#FALSE
100:
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
/******************************************************************/
/* function FY */
/******************************************************************/
functionFY: // INFO: functionFY
stp x1,lr,[sp,-16]! // save registres
ldr x1,qAdrqTabN2
ldr x0,[x1,x12,lsl #3]
bl gameOK // game OK ?
cmp x0,#TRUE
beq 100f
ldr x1,qAdrqTabN4
ldr x0,[x1,x12,lsl #3]
cmp x0,x10
bgt 1f
bl functionFN
b 100f
1:
mov x0,#FALSE
100:
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
/******************************************************************/
/* the empty box is down */
/******************************************************************/
functionFI: // INFO: functionFI
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
stp x6,x7,[sp,-16]! // save registres
stp x8,x9,[sp,-16]! // save registres
ldr x0,qAdrqTabN0
ldr x1,[x0,x12,lsl #3] // empty box
add x2,x1,#4
ldr x3,[x9,x12,lsl #3] // load game current
ldrb w4,[x3,x2] // load box down empty box
add x5,x12,#1 // n+1
add x8,x1,#4 // new position empty case
str x8,[x0,x5,lsl #3] // store new position empty case
ldr x6,qAdrqTabN3
mov x7,#'D' // down
str x7,[x6,x5,lsl #3] // store move
ldr x6,qAdrqTabN4
ldr x7,[x6,x12,lsl #3]
str x7,[x6,x5,lsl #3] // N4 (n+1) = n4(n)
mov x0,x3
bl createGame // create copy game
ldrb w3,[x0,x1] // and inversion box
ldrb w8,[x0,x2]
strb w8,[x0,x1]
strb w3,[x0,x2]
str x0,[x9,x5,lsl #3] // store new game in table
lsr x1,x1,#2 // line position empty case = N°/ 4
ldr x0,qAdrqTabNr
ldr x2,[x0,x4,lsl #3] // load N° line box moved
cmp x2,x1 // compare ????
ble 1f
add x7,x7,#1 // and increment ????
str x7,[x6,x5,lsl #3]
1:
add x12,x12,#1 // increment N
ldp x8,x9,[sp],16 // restaur des 2 registres
ldp x6,x7,[sp],16 // restaur des 2 registres
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
qAdrqTabNr: .quad qTabNr
qAdrqTabNc: .quad qTabNc
/******************************************************************/
/* empty case UP see explain in english in function FI */
/******************************************************************/
functionFG: // INFO: functionFG
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
stp x6,x7,[sp,-16]! // save registres
stp x8,x9,[sp,-16]! // save registres
ldr x0,qAdrqTabN0
ldr x1,[x0,x12,lsl #3] // case vide
sub x2,x1,#4 // position case au dessus
ldr x3,[x9,x12,lsl #3] // extrait jeu courant
ldrb w4,[x3,x2] // extrait le contenu case au dessus
add x5,x12,#1 // N+1 = N
sub x8,x1,#4 // nouvelle position case vide
str x8,[x0,x5,lsl #3] // et on la stocke
ldr x6,qAdrqTabN3
mov x7,#'U' // puis on stocke le code mouvement
str x7,[x6,x5,lsl #3]
ldr x6,qAdrqTabN4
ldr x7,[x6,x12,lsl #3]
str x7,[x6,x5,lsl #3] // N4 (N+1) = N4 (N)
mov x0,x3 // jeu courant
bl createGame // création nouveau jeu
ldrb w3,[x0,x1] // et echange les 2 cases
ldrb w8,[x0,x2]
strb w8,[x0,x1]
strb w3,[x0,x2]
str x0,[x9,x5,lsl #3] // stocke la nouvelle situation
lsr x1,x1,#2 // ligne case vide = position /4
ldr x0,qAdrqTabNr
ldr x2,[x0,x4,lsl #3] // extrait table à la position case
cmp x2,x1 // et comparaison ???
bge 1f
add x7,x7,#1 // puis increment N4 de 1 ???
str x7,[x6,x5,lsl #3]
1:
add x12,x12,#1 // increment de N
ldp x8,x9,[sp],16 // restaur des 2 registres
ldp x6,x7,[sp],16 // restaur des 2 registres
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
/******************************************************************/
/* empty case go right see explain finction FI ou FG en français */
/******************************************************************/
functionFE: // INFO: functionFE
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
stp x6,x7,[sp,-16]! // save registres
stp x8,x9,[sp,-16]! // save registres
ldr x0,qAdrqTabN0
ldr x1,[x0,x12,lsl #3]
add x2,x1,#1
ldr x3,[x9,x12,lsl #3]
ldrb w4,[x3,x2] // extrait le contenu case
add x5,x12,#1
add x8,x1,#1
str x8,[x0,x5,lsl #3] // nouvelle case vide
ldr x6,qAdrqTabN3
mov x7,#'R'
str x7,[x6,x5,lsl #3] // mouvement
ldr x6,qAdrqTabN4
ldr x7,[x6,x12,lsl #3]
str x7,[x6,x5,lsl #3] // N4 ??
mov x0,x3
bl createGame
ldrb w3,[x0,x1] // exchange two boxes
ldrb w8,[x0,x2]
strb w8,[x0,x1]
strb w3,[x0,x2]
str x0,[x9,x5,lsl #3] // stocke la nouvelle situation
lsr x3,x1,#2
sub x1,x1,x3,lsl #2
ldr x0,qAdrqTabNc
ldr x2,[x0,x4,lsl #3] // extrait table à la position case
cmp x2,x1
ble 1f
add x7,x7,#1
str x7,[x6,x5,lsl #3]
1:
add x12,x12,#1
ldp x8,x9,[sp],16 // restaur des 2 registres
ldp x6,x7,[sp],16 // restaur des 2 registres
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
/******************************************************************/
/* empty box go left see explain function FI ou FG en français */
/******************************************************************/
functionFL: // INFO: functionFL
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
stp x6,x7,[sp,-16]! // save registres
stp x8,x9,[sp,-16]! // save registres
ldr x0,qAdrqTabN0
ldr x1,[x0,x12,lsl #3] // case vide
sub x2,x1,#1
ldr x3,[x9,x12,lsl #3] // extrait jeu courant
ldrb w4,[x3,x2] // extrait le contenu case
add x5,x12,#1
sub x8,x1,#1
str x8,[x0,x5,lsl #3] // nouvelle case vide
ldr x6,qAdrqTabN3
mov x7,#'L'
str x7,[x6,x5,lsl #3] // mouvement
ldr x6,qAdrqTabN4
ldr x7,[x6,x12,lsl #3]
str x7,[x6,x5,lsl #3] // N4 ??
mov x0,x3
bl createGame
ldrb w3,[x0,x1] // exchange two boxes
ldrb w8,[x0,x2]
strb w8,[x0,x1]
strb w3,[x0,x2]
str x0,[x9,x5,lsl #3] // stocke la nouvelle situation
lsr x3,x1,#2
sub x1,x1,x3,lsl #2 // compute remainder
ldr x0,qAdrqTabNc
ldr x2,[x0,x4,lsl #3] // extrait table colonne à la position case
cmp x2,x1
bge 1f
add x7,x7,#1
str x7,[x6,x5,lsl #3]
1:
add x12,x12,#1
ldp x8,x9,[sp],16 // restaur des 2 registres
ldp x6,x7,[sp],16 // restaur des 2 registres
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
/******************************************************************/
/* create new Game */
/******************************************************************/
/* x0 contains box address */
/* x0 return address new game */
createGame: // INFO: createGame
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
stp x6,x7,[sp,-16]! // save registres
stp x8,x9,[sp,-16]! // save registres
mov x4,x0 // save value
mov x0,#0 // allocation place heap
mov x8,BRK // call system 'brk'
svc #0
cmp x0,#-1 // allocation error
beq 99f
mov x5,x0 // save address heap for output string
add x0,x0,#SIZE * SIZE // reservation place one element
mov x8,BRK // call system 'brk'
svc #0
cmp x0,#-1 // allocation error
beq 99f
mov x2,#0
1: // loop copy boxes
ldrb w3,[x4,x2]
strb w3,[x5,x2]
add x2,x2,#1
cmp x2,#NBBOX
blt 1b
add x11,x11,#1
mov x0,x5
b 100f
99: // error
ldr x0,qAdrszMessErreur
bl affichageMess
100:
ldp x8,x9,[sp],16 // restaur des 2 registres
ldp x6,x7,[sp],16 // restaur des 2 registres
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
/******************************************************************/
/* read file */
/******************************************************************/
/* x0 contains address stack begin */
traitFic: // INFO: traitFic
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
stp x6,x7,[sp,-16]! // save registres
stp x8,fp,[sp,-16]! // save registres
mov fp,x0 // fp <- start address
ldr x4,[fp] // number of Command line arguments
cmp x4,#1
ble 99f
add x5,fp,#16 // second parameter address
ldr x5,[x5]
ldr x0,qAdrqAdrFicName
str x5,[x0]
ldr x0,qAdrszMessTitre
bl affichageMess // display string
mov x0,x5
bl affichageMess
ldr x0,qAdrszCarriageReturn
bl affichageMess // display carriage return
 
mov x0,AT_FDCWD
mov x1,x5 // file name
mov x2,#O_RDWR // flags
mov x3,#0 // mode
mov x8, #OPEN // call system OPEN
svc 0
cmp x0,#0 // error ?
ble 99f
mov x7,x0 // File Descriptor
ldr x1,qAdrsBuffer // buffer address
mov x2,#TAILLEBUFFER // buffer size
mov x8,#READ // read file
svc #0
cmp x0,#0 // error ?
blt 99f
// extraction datas
ldr x1,qAdrsBuffer // buffer address
add x1,x1,x0
mov x0,#0 // store zéro final
strb w0,[x1]
ldr x0,qAdrtbBox // game box address
ldr x1,qAdrsBuffer // buffer address
bl extracDatas
// close file
mov x0,x7
mov x8, #CLOSE
svc 0
mov x0,#0
b 100f
99: // error
ldr x0,qAdrszMessErreur // error message
bl affichageMess
mov x0,#-1
100:
ldp x8,fp,[sp],16 // restaur des 2 registres
ldp x6,x7,[sp],16 // restaur des 2 registres
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
qAdrqAdrFicName: .quad qAdrFicName
qAdrszMessTitre: .quad szMessTitre
qAdrsBuffer: .quad sBuffer
/******************************************************************/
/* extrac digit file buffer */
/******************************************************************/
/* x0 contains boxs address */
/* x1 contains buffer address */
extracDatas: // INFO: extracDatas
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
stp x6,x7,[sp,-16]! // save registres
stp x8,x9,[sp,-16]! // save registres
mov x7,x0
mov x6,x1
mov x2,#0 // string buffer indice
mov x4,x1 // start digit ascii
mov x5,#0 // box index
1:
ldrb w3,[x6,x2]
cmp x3,#0 // datas end ?
beq 4f
cmp x3,#0xA // line end ?
beq 2f
cmp x3,#',' // box end ?
beq 3f
add x2,x2,#1
b 1b
2:
mov x3,#0
strb w3,[x6,x2] // zero final
add x3,x2,#1 // next character
ldrb w3,[x6,x3]
cmp x3,#0xD // line return
bne 21f
add x2,x2,#2 // yes
b 4f
21:
add x2,x2,#1
b 4f
3:
mov x3,#0 // zero final
strb w3,[x6,x2]
add x2,x2,#1
4:
mov x0,x4 // conversion character ascii in integer
bl conversionAtoD
strb w0,[x7,x5] // and store value on 1 byte box
cmp x0,#0 // empty box ?
bne 5f
ldr x0,qAdrqTabN0
str x5,[x0] // empty box in item zéro
5:
add x5,x5,#1 // increment counter boxes
cmp x5,#NBBOX // number box = maxi ?
bge 100f
add x4,x6,x2 // new start address digit ascii
b 1b
100:
ldp x8,x9,[sp],16 // restaur des 2 registres
ldp x6,x7,[sp],16 // restaur des 2 registres
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
/******************************************************************/
/* control of the game solution */
/******************************************************************/
/* x0 contains boxs address */
/* x0 returns 0 if not possible */
/* x0 returns 1 if possible */
controlSolution: // INFO: controlSolution
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
stp x6,x7,[sp,-16]! // save registres
stp x8,x9,[sp,-16]! // save registres
mov x5,x0
ldr x8,qAdrqTabN0
ldr x8,[x8] // empty box
//mov x7,#0
cmp x8,#1
cset x7,eq
beq 1f
cmp x8,#3
cset x7,eq
beq 1f
cmp x8,#4
cset x7,eq
beq 1f
cmp x8,#6
cset x7,eq
beq 1f
cmp x8,#9
cset x7,eq
beq 1f
cmp x8,#11
cset x7,eq
beq 1f
cmp x8,#12
cset x7,eq
beq 1f
cmp x8,#14
cset x7,eq
1:
mov x9,NBBOX - 1
sub x6,x9,x8
add x7,x7,x6
// count permutations
mov x1,#-1
mov x6,#0
2:
add x1,x1,#1
cmp x1,#NBBOX
bge 80f
cmp x1,x8
beq 2b
ldrb w3,[x5,x1]
mov x2,x1
3:
add x2,x2,#1
cmp x2,#NBBOX
bge 2b
cmp x2,x8
beq 3b
ldrb w4,[x5,x2]
cmp x4,x3
cinc x6,x6,lt
b 3b
80:
add x6,x6,x7
tst x6,#1
cset x0,eq
100:
ldp x8,x9,[sp],16 // restaur des 2 registres
ldp x6,x7,[sp],16 // restaur des 2 registres
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
/******************************************************************/
/* game Ok ? */
/******************************************************************/
/* x0 contains boxs address */
gameOK: // INFO: gameOK
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
mov x2,#0
ldrb w3,[x0,x2]
cmp x3,#0
bne 0f
mov x3,#0xF
0:
add x2,x2,#1
1:
ldrb w4,[x0,x2]
cmp x4,#0
bne 11f
mov x3,#0xF
11:
cmp x4,x3
ble 99f
mov x3,x4
add x2,x2,#1
cmp x2,#NBBOX -2
ble 1b
mov x0,#TRUE // game Ok
b 100f
99:
mov x0,#FALSE // game not Ok
100:
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
/******************************************************************/
/* display game */
/******************************************************************/
/* x0 contains boxs address */
displayGame: // INFO: displayGame
stp x1,lr,[sp,-16]! // save registres
stp x2,x3,[sp,-16]! // save registres
stp x4,x5,[sp,-16]! // save registres
mov x4,x0
ldr x0,qAdrszMessTitre
bl affichageMess // display titre
ldr x0,qAdrqAdrFicName
ldr x0,[x0]
bl affichageMess // display string
ldr x0,qAdrszCarriageReturn
bl affichageMess // display line return
mov x2,#0
ldr x1,qAdrsMessValeur
1:
ldrb w0,[x4,x2]
cmp x0,#0
beq 3f
bl conversion10 // call conversion decimal
cmp x0,1
bne 2f
mov x0,#0x002020
str w0,[x1,#1] // zéro final
b 4f
2:
mov x0,#0x20
str w0,[x1,#2] // zéro final
b 4f
3:
ldr x0,iSpaces // store spaces to empty case
str w0,[x1]
4:
ldr x0,qAdrsMessResult
bl affichageMess // display message
add x0,x2,#1
tst x0,#0b11
bne 5f
ldr x0,qAdrszCarriageReturn
bl affichageMess // display message
5:
add x2,x2,#1
cmp x2,#NBBOX - 1
ble 1b
ldr x0,qAdrszCarriageReturn
bl affichageMess // display line return
 
100:
ldp x4,x5,[sp],16 // restaur des 2 registres
ldp x2,x3,[sp],16 // restaur des 2 registres
ldp x1,lr,[sp],16 // restaur des 2 registres
ret
iSpaces: .quad 0x00202020 // spaces
qAdrszCarriageReturn: .quad szCarriageReturn
qAdrsMessValeur: .quad sMessValeur
qAdrsMessResult: .quad sMessResult
/********************************************************/
/* File Include fonctions */
/********************************************************/
/* for this file see task include a file in language AArch64 assembly */
.include "../includeARM64.inc"
</syntaxhighlight>
<pre>
File name : casR1.txt
File name : casR1.txt
15 14 1 6
9 11 4 12
10 7 3
13 8 5 2
 
File name : casR1.txt
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15
 
Solution in 52 moves :
RRRULDDLUUULDRURDDDRULLULURRRDDLDLUURDDLULURRULDRDRD
</pre>
 
=={{header|Ada}}==
{{trans|C++}} Decoding actually...
<syntaxhighlight lang="ada">with Ada.Text_IO;
 
procedure Puzzle_15 is
 
type Direction is (Up, Down, Left, Right);
type Row_Type is range 0 .. 3;
type Col_Type is range 0 .. 3;
type Tile_Type is range 0 .. 15;
 
To_Col : constant array (Tile_Type) of Col_Type :=
(3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2);
To_Row : constant array (Tile_Type) of Row_Type :=
(3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3);
 
type Board_Type is array (Row_Type, Col_Type) of Tile_Type;
 
Solved_Board : constant Board_Type :=
((1, 2, 3, 4),
(5, 6, 7, 8),
(9, 10, 11, 12),
(13, 14, 15, 0));
 
type Try_Type is
record
Board : Board_Type;
Move : Direction;
Cost : Integer;
Row : Row_Type;
Col : Col_Type;
end record;
 
Stack : array (0 .. 100) of Try_Type;
Top : Natural := 0;
Iteration_Count : Natural := 0;
 
procedure Move_Down is
Board : Board_Type := Stack (Top).Board;
Row : constant Row_Type := Stack (Top).Row;
Col : constant Col_Type := Stack (Top).Col;
Tile : constant Tile_Type := Board (Row + 1, Col);
Penalty : constant Integer :=
(if To_Row (Tile) <= Row then 0 else 1);
begin
Board (Row, Col) := Tile;
Board (Row + 1, Col) := 0;
Stack (Top + 1) := (Board => Board,
Move => Down,
Row => Row + 1,
Col => Col,
Cost => Stack (Top).Cost + Penalty);
end Move_Down;
 
procedure Move_Up is
Board : Board_Type := Stack (Top).Board;
Row : constant Row_Type := Stack (Top).Row;
Col : constant Col_Type := Stack (Top).Col;
Tile : constant Tile_Type := Board (Row - 1, Col);
Penalty : constant Integer :=
(if To_Row (Tile) >= Row then 0 else 1);
begin
Board (Row, Col) := Tile;
Board (Row - 1, Col) := 0;
Stack (Top + 1) := (Board => Board,
Move => Up,
Row => Row - 1,
Col => Col,
Cost => Stack (Top).Cost + Penalty);
end Move_Up;
 
procedure Move_Left is
Board : Board_Type := Stack (Top).Board;
Row : constant Row_Type := Stack (Top).Row;
Col : constant Col_Type := Stack (Top).Col;
Tile : constant Tile_Type := Board (Row, Col - 1);
Penalty : constant Integer :=
(if To_Col (Tile) >= Col then 0 else 1);
begin
Board (Row, Col) := Tile;
Board (Row, Col - 1) := 0;
Stack (Top + 1) := (Board => Board,
Move => Left,
Row => Row,
Col => Col - 1,
Cost => Stack (Top).Cost + Penalty);
end Move_Left;
 
procedure Move_Right is
Board : Board_Type := Stack (Top).Board;
Row : constant Row_Type := Stack (Top).Row;
Col : constant Col_Type := Stack (Top).Col;
Tile : constant Tile_Type := Board (Row, Col + 1);
Penalty : constant Integer :=
(if To_Col (Tile) <= Col then 0 else 1);
begin
Board (Row, Col) := Tile;
Board (Row, Col + 1) := 0;
Stack (Top + 1) := (Board => Board,
Move => Right,
Row => Row,
Col => Col + 1,
Cost => Stack (Top).Cost + Penalty);
end Move_Right;
 
function Is_Solution return Boolean;
 
function Test_Moves return Boolean is
begin
if
Stack (Top).Move /= Down and then
Stack (Top).Row /= Row_Type'First
then
Move_Up;
Top := Top + 1;
if Is_Solution then return True; end if;
Top := Top - 1;
end if;
 
if
Stack (Top).Move /= Up and then
Stack (Top).Row /= Row_Type'Last
then
Move_Down;
Top := Top + 1;
if Is_Solution then return True; end if;
Top := Top - 1;
end if;
 
if
Stack (Top).Move /= Right and then
Stack (Top).Col /= Col_Type'First
then
Move_Left;
Top := Top + 1;
if Is_Solution then return True; end if;
Top := Top - 1;
end if;
 
if
Stack (Top).Move /= Left and then
Stack (Top).Col /= Col_Type'Last
then
Move_Right;
Top := Top + 1;
if Is_Solution then return True; end if;
Top := Top - 1;
end if;
 
return False;
end Test_Moves;
 
function Is_Solution return Boolean is
use Ada.Text_IO;
begin
if Stack (Top).Board = Solved_Board then
Put ("Solved in " & Top'Image & " moves: ");
for R in 1 .. Top loop
Put (String'(Stack (R).Move'Image) (1));
end loop;
New_Line;
return True;
end if;
if Stack (Top).Cost <= Iteration_Count then
return Test_Moves;
end if;
return False;
end Is_Solution;
 
procedure Solve (Row : in Row_Type;
Col : in Col_Type;
Board : in Board_Type) is
begin
pragma Assert (Board (Row, Col) = 0);
Top := 0;
Iteration_Count := 0;
Stack (Top) := (Board => Board,
Row => Row,
Col => Col,
Move => Down,
Cost => 0);
while not Is_Solution loop
Iteration_Count := Iteration_Count + 1;
end loop;
end Solve;
 
begin
Solve (Row => 2,
Col => 0,
Board => ((15, 14, 1, 6),
(9, 11, 4, 12),
(0, 10, 7, 3),
(13, 8, 5, 2)));
end Puzzle_15;</syntaxhighlight>
{{out}}
<pre>Solved in 52 moves: RRRULDDLUUULDRURDDDRULLULURRRDDLDLUURDDLULURRULDRDRD</pre>
 
=={{header|ARM Assembly}}==
{{works with|as|Raspberry Pi}}
<syntaxhighlight lang="arm assembly">
/* ARM assembly Raspberry PI */
/* program puzzle15solver.s */
/* my first other program find à solution in 134 moves !!! */
/* this second program is a adaptation algorithme C++ and go rosetta code */
/* thanck for the creators */
/* 1 byte by box on game board */
 
/* create a file with nano */
/* 15, 2, 3, 4
5, 6, 7, 1
9, 10, 8, 11
13, 14, 12, 0 */
/* Run this programm : puzzle15solver <file name> */
/* wait several minutes for résult */
 
/* REMARK 1 : this program use routines in a include file
see task Include a file language arm assembly
for the routine affichageMess conversion10
see at end of this program the instruction include */
/* for constantes see task include a file in arm assembly */
/************************************/
/* Constantes */
/************************************/
.include "../constantes.inc"
 
.equ STDIN, 0 @ Linux input console
.equ STDOUT, 1 @ Linux output console
.equ EXIT, 1 @ Linux syscall
.equ READ, 3 @ Linux syscall
.equ WRITE, 4 @ Linux syscall
.equ OPEN, 5 @ Linux syscall
.equ CLOSE, 6 @ Linux syscall
 
.equ TRUE, 1
.equ FALSE, 0
 
.equ O_RDWR, 0x0002 @ open for reading and writing
 
.equ SIZE, 4
.equ NBBOX, SIZE * SIZE
.equ TAILLEBUFFER, 100
.equ NBMAXIELEMENTS, 100
 
.equ CONST_I, 1
.equ CONST_G, 8
.equ CONST_E, 2
.equ CONST_L, 4
 
/*********************************/
/* Initialized data */
/*********************************/
.data
szMessTitre: .asciz "Nom du fichier : "
sMessResult: .ascii " "
sMessValeur: .fill 11, 1, ' ' @ size => 11
szCarriageReturn: .asciz "\n"
szMessCounterSolution: .asciz "Solution in @ moves : \n"
 
//szMessMoveError: .asciz "Huh... Impossible move !!!!\n"
szMessErreur: .asciz "Error detected.\n"
szMessImpossible: .asciz "!!! Impossible solution !!!\n"
szMessErrBuffer: .asciz "buffer size too less !!"
szMessSpaces: .asciz " "
 
iTabNr: .int 3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3
iTabNc: .int 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2
/*********************************/
/* UnInitialized data */
/*********************************/
.bss
.align 4
sZoneConv: .skip 24
iAdrHeap: .skip 4
ibox: .skip SIZE * SIZE @ game boxes
iAdrFicName: .skip 4
iTabN0: .skip 4 * NBMAXIELEMENTS @ empty box
iTabN3: .skip 4 * NBMAXIELEMENTS @ moves
iTabN4: .skip 4 * NBMAXIELEMENTS @ ????
iTabN2: .skip 4 * NBMAXIELEMENTS @ table game address
sBuffer: .skip TAILLEBUFFER
/*********************************/
/* code section */
/*********************************/
.text
.global main
main: @ INFO: main
mov r0,sp @ stack address for load parameter
bl traitFic @ read file and store value in array
cmp r0,#-1
beq 100f @ error ?
 
ldr r0,iAdribox
bl displayGame @ display array game
ldr r0,iAdribox @ control if solution exists
bl controlSolution
cmp r0,#TRUE
beq 1f
ldr r0,iAdrszMessImpossible @ no solution !!!
bl affichageMess
b 100f
 
1:
ldr r0,iAdribox
ldr r9,iAdriTabN2
str r0,[r9] @ N2 address global
mov r10,#0 @ variable _n global
mov r12,#0 @ variable n global
bl searchSolution
cmp r0,#TRUE
bne 100f @ no solution ?
ldr r3,iAdriTabN2
ldr r0,[r3,r12,lsl #2] @ visual solution control
bl displayGame
mov r0,r12 @ move counter
ldr r1,iAdrsZoneConv
bl conversion10 @ conversion counter
mov r2,#0
strb r2,[r1,r0] @ and display
ldr r0,iAdrszMessCounterSolution
bl strInsertAtCharInc
ldr r1,iAdrsZoneConv
bl affichageMess
ldr r5,iAdriTabN3
ldr r3,iAdrsBuffer
mov r2,#1
mov r4,#0
2: @ loop solution display
ldrb r1,[r5,r2,lsl #2]
cmp r2,#TAILLEBUFFER
bge 99f
strb r1,[r3,r4]
add r4,r4,#1
add r2,r2,#1
cmp r2,r12
ble 2b
mov r1,#0
str r1,[r3,r4] @ zéro final
mov r0,r3
bl affichageMess
ldr r0,iAdrszCarriageReturn
bl affichageMess
b 100f
 
99:
ldr r0,iAdrszMessErrBuffer
bl affichageMess
100: @ standard end of the program
mov r0, #0 @ return code
mov r7, #EXIT @ request to exit program
svc #0 @ perform the system call
iAdribox: .int ibox
iAdriTabN0: .int iTabN0
iAdriTabN2: .int iTabN2
iAdriTabN3: .int iTabN3
iAdriTabN4: .int iTabN4
iAdrszMessCounterSolution: .int szMessCounterSolution
iAdrszMessImpossible: .int szMessImpossible
iAdrszMessErrBuffer: .int szMessErrBuffer
iAdrsZoneConv: .int sZoneConv
/******************************************************************/
/* search Solution */
/******************************************************************/
searchSolution: @ INFO: searchSolution
push {r1-r8,lr} @ save registers
@ address allocation place on the heap
mov r0,#0 @ allocation place heap
mov r7,#0x2D @ call system 'brk'
svc #0
cmp r0,#-1 @ allocation error
beq 99f
ldr r1,iAdriAdrHeap
str r0,[r1] @ store heap address
bl functionFN
ldr r3,iAdriTabN2
ldr r0,[r3,r12,lsl #2] @ last current game
bl gameOK @ it is Ok ?
cmp r0,#TRUE
beq 100f @ yes --> end
 
ldr r1,iAdriAdrHeap @ free up resources
ldr r0,[r1] @ restaur start address heap
mov r7,#0x2D @ call system 'brk'
svc #0
cmp r0,#-1 @ allocation error
beq 99f
add r10,r10,#1 @ _n
mov r12,#0 @ n
bl searchSolution @ next recursif call
b 100f
99:
ldr r0,iAdrszMessErreur
bl affichageMess
100:
pop {r1-r8,lr} @ restaur registers
bx lr @return
iAdrszMessErreur: .int szMessErreur
iAdriAdrHeap: .int iAdrHeap
/******************************************************************/
/* Fonction FN */
/******************************************************************/
functionFN: @ INFO: functionFN
push {lr} @ save register
ldr r4,iAdriTabN3
ldr r3,[r4,r12,lsl #2]
ldr r5,iAdriTabN0 @ load position empty box
ldr r6,[r5,r12,lsl #2]
cmp r6,#15 @ last box
bne 2f
cmp r3,#'R'
bne 11f
mov r0,#CONST_G
bl functionFZ
b 100f
11:
cmp r3,#'D'
bne 12f
mov r0,#CONST_L
bl functionFZ
b 100f
12:
mov r0,#CONST_G + CONST_L
bl functionFZ
b 100f
2:
cmp r6,#12
bne 3f
cmp r3,#'L'
bne 21f
mov r0,#CONST_G
bl functionFZ
b 100f
21:
cmp r3,#'D'
bne 22f
mov r0,#CONST_E
bl functionFZ
b 100f
22:
mov r0,#CONST_E + CONST_G
bl functionFZ
b 100f
3:
cmp r6,#13
beq 30f
cmp r6,#14
bne 4f
30:
cmp r3,#'L'
bne 31f
mov r0,#CONST_G + CONST_L
bl functionFZ
b 100f
31:
cmp r3,#'R'
bne 32f
mov r0,#CONST_G + CONST_E
bl functionFZ
b 100f
32:
cmp r3,#'D'
bne 33f
mov r0,#CONST_E + CONST_L
bl functionFZ
b 100f
33:
mov r0,#CONST_L + CONST_E + CONST_G
bl functionFZ
b 100f
4:
cmp r6,#3
bne 5f
cmp r3,#'R'
bne 41f
mov r0,#CONST_I
bl functionFZ
b 100f
41:
cmp r3,#'U'
bne 42f
mov r0,#CONST_L
bl functionFZ
b 100f
42:
mov r0,#CONST_I + CONST_L
bl functionFZ
b 100f
5:
cmp r6,#0
bne 6f
cmp r3,#'L'
bne 51f
mov r0,#CONST_I
bl functionFZ
b 100f
51:
cmp r3,#'U'
bne 52f
mov r0,#CONST_E
bl functionFZ
b 100f
52:
mov r0,#CONST_I + CONST_E
bl functionFZ
b 100f
6:
cmp r6,#1
beq 60f
cmp r6,#2
bne 7f
60:
cmp r3,#'L'
bne 61f
mov r0,#CONST_I + CONST_L
bl functionFZ
b 100f
61:
cmp r3,#'R'
bne 62f
mov r0,#CONST_E + CONST_I
bl functionFZ
b 100f
62:
cmp r3,#'U'
bne 63f
mov r0,#CONST_E + CONST_L
bl functionFZ
b 100f
63:
mov r0,#CONST_I + CONST_E + CONST_L
bl functionFZ
b 100f
7:
cmp r6,#7
beq 70f
cmp r6,#11
bne 8f
70:
cmp r3,#'R'
bne 71f
mov r0,#CONST_I + CONST_G
bl functionFZ
b 100f
71:
cmp r3,#'U'
bne 72f
mov r0,#CONST_G + CONST_L
bl functionFZ
b 100f
72:
cmp r3,#'D'
bne 73f
mov r0,#CONST_I + CONST_L
bl functionFZ
b 100f
73:
mov r0,#CONST_I + CONST_G + CONST_L
bl functionFZ
b 100f
8:
cmp r6,#4
beq 80f
cmp r6,#8
bne 9f
80:
cmp r3,#'D'
bne 81f
mov r0,#CONST_I + CONST_E
bl functionFZ
b 100f
81:
cmp r3,#'U'
bne 82f
mov r0,#CONST_G + CONST_E
bl functionFZ
b 100f
82:
cmp r3,#'L'
bne 83f
mov r0,#CONST_I + CONST_G
bl functionFZ
b 100f
83:
mov r0,#CONST_G + CONST_E + CONST_I
bl functionFZ
b 100f
9:
cmp r3,#'D'
bne 91f
mov r0,#CONST_I + CONST_E + CONST_L
bl functionFZ
b 100f
91:
cmp r3,#'L'
bne 92f
mov r0,#CONST_I + CONST_G + CONST_L
bl functionFZ
b 100f
92:
cmp r3,#'R'
bne 93f
mov r0,#CONST_I + CONST_G + CONST_E
bl functionFZ
b 100f
93:
cmp r3,#'U'
bne 94f
mov r0,#CONST_G + CONST_E + CONST_L
bl functionFZ
b 100f
94:
mov r0,#CONST_G + CONST_L + CONST_I + CONST_E
bl functionFZ
b 100f
 
99: @ error
ldr r0,iAdrszMessErreur
bl affichageMess
100:
pop {lr} @ restaur registers
bx lr @return
 
/******************************************************************/
/* function FZ */
/* */
/***************************************************************/
/* r0 contains variable w */
functionFZ: @ INFO: functionFZ
push {r1,r2,lr} @ save registers
mov r2,r0
and r1,r2,#CONST_I
cmp r1,#0
ble 1f
bl functionFI
bl functionFY
cmp r0,#TRUE
beq 100f
sub r12,r12,#1 @ variable n
1:
ands r1,r2,#CONST_G
ble 2f
bl functionFG
bl functionFY
cmp r0,#TRUE
beq 100f
sub r12,r12,#1 @ variable n
2:
ands r1,r2,#CONST_E
ble 3f
bl functionFE
bl functionFY
cmp r0,#TRUE
beq 100f
sub r12,r12,#1 @ variable n
3:
ands r1,r2,#CONST_L
ble 4f
bl functionFL
bl functionFY
cmp r0,#TRUE
beq 100f
sub r12,r12,#1 @ variable n
4:
mov r0,#FALSE
100:
pop {r1,r2,lr} @ restaur registers
bx lr @return
/******************************************************************/
/* function FY */
/******************************************************************/
functionFY: @ INFO: functionFY
push {lr} @ save registers
ldr r1,iAdriTabN2
ldr r0,[r1,r12,lsl #2]
bl gameOK @ game OK ?
cmp r0,#TRUE
beq 100f
ldr r1,iAdriTabN4
ldr r0,[r1,r12,lsl #2]
cmp r0,r10
bgt 1f
bl functionFN
b 100f
1:
mov r0,#FALSE
100:
pop {lr} @ restaur registers
bx lr @return
 
/******************************************************************/
/* the empty box is down */
/******************************************************************/
functionFI: @ INFO: functionFI
push {r0-r8,lr} @ save registers
ldr r0,iAdriTabN0
ldr r1,[r0,r12,lsl #2] @ empty box
add r2,r1,#4
ldr r3,[r9,r12,lsl #2] @ load game current
ldrb r4,[r3,r2] @ load box down empty box
add r5,r12,#1 @ n+1
add r8,r1,#4 @ new position empty case
str r8,[r0,r5,lsl #2] @ store new position empty case
ldr r6,iAdriTabN3
mov r7,#'D' @ down
str r7,[r6,r5,lsl #2] @ store move
ldr r6,iAdriTabN4
ldr r7,[r6,r12,lsl #2]
str r7,[r6,r5,lsl #2] @ N4 (n+1) = n4(n)
mov r0,r3
bl createGame @ create copy game
ldrb r3,[r0,r1] @ and inversion box
ldrb r8,[r0,r2]
strb r8,[r0,r1]
strb r3,[r0,r2]
str r0,[r9,r5,lsl #2] @ store new game in table
lsr r1,r1,#2 @ line position empty case = N°/ 4
ldr r0,iAdriTabNr
ldr r2,[r0,r4,lsl #2] @ load N° line box moved
cmp r2,r1 @ compare ????
ble 1f
add r7,r7,#1 @ and increment ????
str r7,[r6,r5,lsl #2]
1:
add r12,r12,#1 @ increment N
pop {r0-r8,lr}
bx lr @return
iAdriTabNr: .int iTabNr
iAdriTabNc: .int iTabNc
/******************************************************************/
/* empty case UP see explain in english in function FI */
/******************************************************************/
functionFG: @ INFO: functionFG
push {r0-r8,lr} @ save registers
ldr r0,iAdriTabN0
ldr r1,[r0,r12,lsl #2] @ case vide
sub r2,r1,#4 @ position case au dessus
ldr r3,[r9,r12,lsl #2] @ extrait jeu courant
ldrb r4,[r3,r2] @ extrait le contenu case au dessus
add r5,r12,#1 @ N+1 = N
sub r8,r1,#4 @ nouvelle position case vide
str r8,[r0,r5,lsl #2] @ et on la stocke
ldr r6,iAdriTabN3
mov r7,#'U' @ puis on stocke le code mouvement
str r7,[r6,r5,lsl #2]
ldr r6,iAdriTabN4
ldr r7,[r6,r12,lsl #2]
str r7,[r6,r5,lsl #2] @ N4 (N+1) = N4 (N)
mov r0,r3 @ jeu courant
bl createGame @ création nouveau jeu
ldrb r3,[r0,r1] @ et echange les 2 cases
ldrb r8,[r0,r2]
strb r8,[r0,r1]
strb r3,[r0,r2]
str r0,[r9,r5,lsl #2] @ stocke la nouvelle situation
lsr r1,r1,#2 @ ligne case vide = position /4
ldr r0,iAdriTabNr
ldr r2,[r0,r4,lsl #2] @ extrait table à la position case
cmp r2,r1 @ et comparaison ???
bge 1f
add r7,r7,#1 @ puis increment N4 de 1 ???
str r7,[r6,r5,lsl #2]
1:
add r12,r12,#1 @ increment de N
pop {r0-r8,lr}
bx lr @return
/******************************************************************/
/* empty case go right see explain finction FI ou FG en français */
/******************************************************************/
functionFE: @ INFO: functionFE
push {r0-r8,lr} @ save registers
ldr r0,iAdriTabN0
ldr r1,[r0,r12,lsl #2]
add r2,r1,#1
ldr r3,[r9,r12,lsl #2]
ldrb r4,[r3,r2] @ extrait le contenu case
add r5,r12,#1
add r8,r1,#1
str r8,[r0,r5,lsl #2] @ nouvelle case vide
ldr r6,iAdriTabN3
mov r7,#'R'
str r7,[r6,r5,lsl #2] @ mouvement
ldr r6,iAdriTabN4
ldr r7,[r6,r12,lsl #2]
str r7,[r6,r5,lsl #2] @ N4 ??
mov r0,r3
bl createGame
ldrb r3,[r0,r1] @ exchange two boxes
ldrb r8,[r0,r2]
strb r8,[r0,r1]
strb r3,[r0,r2]
str r0,[r9,r5,lsl #2] @ stocke la nouvelle situation
lsr r3,r1,#2
sub r1,r1,r3,lsl #2
ldr r0,iAdriTabNc
ldr r2,[r0,r4,lsl #2] @ extrait table à la position case
cmp r2,r1
ble 1f
add r7,r7,#1
str r7,[r6,r5,lsl #2]
1:
add r12,r12,#1
pop {r0-r8,lr}
bx lr @return
/******************************************************************/
/* empty box go left see explain function FI ou FG en français */
/******************************************************************/
functionFL: @ INFO: functionFL
push {r0-r8,lr} @ save registers
ldr r0,iAdriTabN0
ldr r1,[r0,r12,lsl #2] @ case vide
sub r2,r1,#1
ldr r3,[r9,r12,lsl #2] @ extrait jeu courant
ldrb r4,[r3,r2] @ extrait le contenu case
add r5,r12,#1
sub r8,r1,#1
str r8,[r0,r5,lsl #2] @ nouvelle case vide
ldr r6,iAdriTabN3
mov r7,#'L'
str r7,[r6,r5,lsl #2] @ mouvement
ldr r6,iAdriTabN4
ldr r7,[r6,r12,lsl #2]
str r7,[r6,r5,lsl #2] @ N4 ??
mov r0,r3
bl createGame
ldrb r3,[r0,r1] @ exchange two boxes
ldrb r8,[r0,r2]
strb r8,[r0,r1]
strb r3,[r0,r2]
str r0,[r9,r5,lsl #2] @ stocke la nouvelle situation
lsr r3,r1,#2
sub r1,r1,r3,lsl #2 @ compute remainder
ldr r0,iAdriTabNc
ldr r2,[r0,r4,lsl #2] @ extrait table colonne à la position case
cmp r2,r1
bge 1f
add r7,r7,#1
str r7,[r6,r5,lsl #2]
1:
add r12,r12,#1
pop {r0-r8,lr}
bx lr @return
/******************************************************************/
/* create new Game */
/******************************************************************/
/* r0 contains box address */
/* r0 return address new game */
createGame: @ INFO: createGame
push {r1-r8,lr} @ save registers
mov r4,r0 @ save value
mov r0,#0 @ allocation place heap
mov r7,#0x2D @ call system 'brk'
svc #0
cmp r0,#-1 @ allocation error
beq 99f
mov r5,r0 @ save address heap for output string
add r0,#SIZE * SIZE @ reservation place one element
mov r7,#0x2D @ call system 'brk'
svc #0
cmp r0,#-1 @ allocation error
beq 99f
mov r2,#0
1: @ loop copy boxes
ldrb r3,[r4,r2]
strb r3,[r5,r2]
add r2,r2,#1
cmp r2,#NBBOX
blt 1b
add r11,r11,#1
mov r0,r5
b 100f
99: @ error
ldr r0,iAdrszMessErreur
bl affichageMess
100:
pop {r1-r8,lr} @ restaur registers
bx lr @return
/******************************************************************/
/* read file */
/******************************************************************/
/* r0 contains address stack begin */
traitFic: @ INFO: traitFic
push {r1-r8,fp,lr} @ save registers
mov fp,r0 @ fp <- start address
ldr r4,[fp] @ number of Command line arguments
cmp r4,#1
movle r0,#-1
ble 99f
add r5,fp,#8 @ second parameter address
ldr r5,[r5]
ldr r0,iAdriAdrFicName
str r5,[r0]
ldr r0,iAdrszMessTitre
bl affichageMess @ display string
mov r0,r5
bl affichageMess
ldr r0,iAdrszCarriageReturn
bl affichageMess @ display carriage return
 
mov r0,r5 @ file name
mov r1,#O_RDWR @ flags
mov r2,#0 @ mode
mov r7, #OPEN @ call system OPEN
svc 0
cmp r0,#0 @ error ?
ble 99f
mov r8,r0 @ File Descriptor
ldr r1,iAdrsBuffer @ buffer address
mov r2,#TAILLEBUFFER @ buffer size
mov r7,#READ @ read file
svc #0
cmp r0,#0 @ error ?
blt 99f
@ extraction datas
ldr r1,iAdrsBuffer @ buffer address
add r1,r0
mov r0,#0 @ store zéro final
strb r0,[r1]
ldr r0,iAdribox @ game box address
ldr r1,iAdrsBuffer @ buffer address
bl extracDatas
@ close file
mov r0,r8
mov r7, #CLOSE
svc 0
mov r0,#0
b 100f
99: @ error
ldr r1,iAdrszMessErreur @ error message
bl displayError
mov r0,#-1
100:
pop {r1-r8,fp,lr} @ restaur registers
bx lr @return
iAdriAdrFicName: .int iAdrFicName
iAdrszMessTitre: .int szMessTitre
iAdrsBuffer: .int sBuffer
/******************************************************************/
/* extrac digit file buffer */
/******************************************************************/
/* r0 contains boxs address */
/* r1 contains buffer address */
extracDatas: @ INFO: extracDatas
push {r1-r8,lr} @ save registers
mov r7,r0
mov r6,r1
mov r2,#0 @ string buffer indice
mov r4,r1 @ start digit ascii
mov r5,#0 @ box index
1:
ldrb r3,[r6,r2]
cmp r3,#0
beq 4f @ end
cmp r3,#0xA
beq 2f
cmp r3,#','
beq 3f
add r2,#1
b 1b
2:
mov r3,#0
strb r3,[r6,r2]
ldrb r3,[r6,r2]
cmp r3,#0xD
addeq r2,#2
addne r2,#1
b 4f
3:
mov r3,#0
strb r3,[r6,r2]
add r2,#1
4:
mov r0,r4
bl conversionAtoD
strb r0,[r7,r5]
cmp r0,#0
ldreq r0,iAdriTabN0
streq r5,[r0] @ empty box in item zéro
add r5,#1
cmp r5,#NBBOX @ number box = maxi ?
bge 100f
add r4,r6,r2 @ new start address digit ascii
b 1b
100:
pop {r1-r8,lr} @ restaur registers
bx lr @return
/******************************************************************/
/* control of the game solution */
/******************************************************************/
/* r0 contains boxs address */
/* r0 returns 0 if not possible */
/* r0 returns 1 if possible */
controlSolution: @ INFO: controlSolution
push {r1-r8,lr} @ save registers
mov r5,r0
ldr r8,iAdriTabN0
ldr r8,[r8] @ empty box
@ empty box
mov r7,#0
cmp r8,#1
moveq r7,#1
beq 1f
cmp r8,#3
moveq r7,#1
beq 1f
cmp r8,#4
moveq r7,#1
beq 1f
cmp r8,#6
moveq r7,#1
beq 1f
cmp r8,#9
moveq r7,#1
beq 1f
cmp r8,#11
moveq r7,#1
beq 1f
cmp r8,#12
moveq r7,#1
beq 1f
cmp r8,#14
moveq r7,#1
1:
rsb r6,r8,#NBBOX - 1
add r7,r6
@ count permutations
mov r1,#-1
mov r6,#0
2:
add r1,#1
cmp r1,#NBBOX
bge 80f
cmp r1,r8
beq 2b
ldrb r3,[r5,r1]
mov r2,r1
3:
add r2,#1
cmp r2,#NBBOX
bge 2b
cmp r2,r8
beq 3b
ldrb r4,[r5,r2]
cmp r4,r3
addlt r6,#1
b 3b
80:
add r6,r7
tst r6,#1
movne r0,#0 @ impossible
moveq r0,#1 @ OK
 
100:
pop {r1-r8,lr} @ restaur registers
bx lr @return
/******************************************************************/
/* game Ok ? */
/******************************************************************/
/* r0 contains boxs address */
gameOK: @ INFO: gameOK
push {r1-r4,lr} @ save registers
mov r2,#0
ldrb r3,[r0,r2]
cmp r3,#0
moveq r3,#0xF
add r2,#1
1:
ldrb r4,[r0,r2]
cmp r4,#0
moveq r3,#0xF
cmp r4,r3
movle r0,#FALSE @ game not Ok
ble 100f
mov r3,r4
add r2,#1
cmp r2,#NBBOX -2
ble 1b
mov r0,#TRUE @ game Ok
 
100:
pop {r1-r4,lr} @ restaur registers
bx lr @return
/******************************************************************/
/* display game */
/******************************************************************/
/* r0 contains boxs address */
displayGame: @ INFO: displayGame
push {r0-r5,lr} @ save registers
mov r4,r0
ldr r0,iAdrszMessTitre
bl affichageMess @ display string
ldr r0,iAdriAdrFicName
ldr r0,[r0]
bl affichageMess @ display string
ldr r0,iAdrszCarriageReturn
bl affichageMess @ display line return
mov r2,#0
ldr r1,iAdrsMessValeur
1:
ldrb r0,[r4,r2]
cmp r0,#0
ldreq r0,iSpaces @ store spaces
streq r0,[r1]
beq 2f
bl conversion10 @ call conversion decimal
mov r0,#0
strb r0,[r1,#3] @ zéro final
2:
 
ldr r0,iAdrsMessResult
bl affichageMess @ display message
add r0,r2,#1
tst r0,#0b11
bne 3f
ldr r0,iAdrszCarriageReturn
bl affichageMess @ display message
3:
add r2,#1
cmp r2,#NBBOX - 1
ble 1b
ldr r0,iAdrszCarriageReturn
bl affichageMess @ display line return
 
100:
pop {r0-r5,lr} @ restaur registers
bx lr @return
iSpaces: .int 0x00202020 @ spaces
//iAdrszMessMoveError: .int szMessMoveError
iAdrszCarriageReturn: .int szCarriageReturn
iAdrsMessValeur: .int sMessValeur
iAdrsMessResult: .int sMessResult
/***************************************************/
/* ROUTINES INCLUDE */
/***************************************************/
.include "../affichage.inc"
</syntaxhighlight>
<pre>
Nom du fichier : casR1.txt
Nom du fichier : casR1.txt
15 14 1 6
9 11 4 12
10 7 3
13 8 5 2
 
Nom du fichier : casR1.txt
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15
 
Solution in 52 moves :
RRRULDDLUUULDRURDDDRULLULURRRDDLDLUURDDLULURRULDRDRD
</pre>
 
=={{header|C}}==
===IDA*===
<syntaxhighlight lang="c">
/**@file HybridIDA.c
* @brief solve 4x4 sliding puzzle with IDA* algorithm
* by RMM 2021-feb-22
* The Interative Deepening A* is relatively easy to code in 'C' since
* it does not need Queues and Lists to manage memory. Instead the
* search space state is held on the LIFO stack frame of recursive
* search function calls. Millions of nodes may be created but they
* are automatically deleted during backtracking.
 
* Run-time is a disadvantage with complex puzzles. Also it struggles
* to solve puzzles with depth g>50. I provided a test puzzle of g=52
* that works with ordinary search but the Rosetta challenge puzzle
* cycles forever. The HybridIDA solves it in 18 seconds.
* The HybridIDA solution has two phases.
* 1. It stops searching when a permutation begins with 1234.
* 2. Phase2 begins a regular search with the output of phase 1.
 
* (But an regular one time search can be done with phase 2
* only). Phase 1 is optional.)
* Pros: Hybrid IDA* is faster and solves more puzzles.
* Cons: May not find shortest path.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
 
typedef unsigned char u8t;
typedef unsigned short u16t;
enum { NR=4, NC=4, NCELLS = NR*NC };
enum { UP, DOWN, LEFT, RIGHT, NDIRS };
enum { OK = 1<<8, XX = 1<<9, FOUND = 1<<10, zz=0x80 };
enum { MAX_INT=0x7E, MAX_NODES=(16*65536)*90};
enum { BIT_HDR=1<<0, BIT_GRID=1<<1, BIT_OTHER=1<<2 };
enum { PHASE1,PHASE2 }; // solution phase
 
typedef struct { u16t dn; u16t hn; }HSORT_T;
 
typedef struct {
u8t data[NCELLS]; unsigned id; unsigned src;
u8t h; u8t g; u8t udlr;
}NODE_T; // contains puzzle data and metadata
 
NODE_T goal44={
{1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,0},0,0,0,0,0};
NODE_T work; // copy of puzzle with run-time changes
 
NODE_T G34={ //g=34; n=248,055; (1phase)
{13,9,5,4, 15,6,1,8, 0,10,2,11, 14,3,7,12},0,0,0,0,0};
 
NODE_T G52={ // g=52; n=34,296,567; (1phase)
{15,13,9,5, 14,6,1,4, 10,12,0,8, 3,7,11,2},0,0,0,0,0};
 
NODE_T G99={ // formidable Rosetta challenge (2phases)
{15,14,1,6, 9,11,4,12, 0,10,7,3, 13,8,5,2},0,0,0,0,0};
 
struct {
unsigned nodes;
unsigned gfound;
unsigned root_visits;
unsigned verbose;
unsigned locks;
unsigned phase;
}my;
 
u16t HybridIDA_star(NODE_T *pNode);
u16t make_node(NODE_T *pNode, NODE_T *pNew, u8t udlr );
u16t search(NODE_T *pNode, u16t bound);
u16t taxi_dist( NODE_T *pNode);
u16t tile_home( NODE_T *p44);
void print_node( NODE_T *pN, const char *pMsg, short force );
u16t goal_found(NODE_T *pNode);
char udlr_to_char( char udlr );
void idx_to_rc( u16t idx, u16t *row, u16t *col );
void sort_nodes(HSORT_T *p);
 
int main( )
{
my.verbose = 0; // minimal print node
// my.verbose |= BIT_HDR; // node header
// my.verbose |= BIT_GRID; // node 4x4 data
memcpy(&work, &G99, sizeof(NODE_T)); // select puzzle here
if(1){ // phase1 can skipped for easy puzzles
printf("Phase1: IDA* search for 1234 permutation..\n");
my.phase = PHASE1;
(void) HybridIDA_star(&work);
}
printf("Phase2: IDA* search phase1 seed..\n");
my.phase = PHASE2;
(void)HybridIDA_star(&work);
return 0;
}
 
void fZ(const N n, const int g){
/// \brief driver for Iterative Deepining A*
if (std::get<2>(n)==0x123456789abcdef0){
u16t HybridIDA_star(NODE_T *pN){
int g{};for (char a: std::get<3>(n)) ++g;
my.nodes = 1;
std::cout<<"Solution found with "<<g<<" moves: "<<std::get<3>(n)<<std::endl; exit(0);}
my.gfound = 0;
if (std::get<4>(n) <= g) fN(n,g);
my.root_visits = 0;
pN->udlr = NDIRS;
pN->g = 0;
pN->h = taxi_dist(pN);
pN->id = my.nodes;
pN->src = 0;
const char *pr = {"Start"}; // for g++
print_node( pN,pr,1 );
u16t depth = pN->h;
while(1){
depth = search(pN,depth);
if( depth & FOUND){
return FOUND; // goodbye
}
if( depth & 0xFF00 ){
printf("..error %x\n",depth);
return XX;
}
my.root_visits++;
printf("[root visits: %u, depth %u]\n",my.root_visits,depth);
}
return 0;
}
 
void fN(const N n, const int g){
/// \brief search is recursive. nodes are instance variables
const int i{std::get<0>(n)}, e{std::get<1>(n)}, l{std::get<3>(n).back()};
u16t search(NODE_T *pN, u16t bound){
switch(i){case 0: switch(e){case 0: switch(l){case 'l': fZ(fI(n),g); return;
if(bound & 0xff00){ return bound; }
case 'u': fZ(fE(n),g); return;
u16t f = pN->g + pN->h;
default : fZ(fE(n),g); fZ(fI(n),g); return;}
if( f > bound){ return f; }
case 3: switch(l){case 'r': fZ(fI(n),g); return;
if(goal_found(pN)){
case 'u': fZ(fL(n),g); return;
my.gfound = pN->g;
default : fZ(fL(n),g); fZ(fI(n),g); return;}
memcpy(&work,pN,sizeof(NODE_T));
default: switch(l){case 'l': fZ(fI(n),g); fZ(fL(n),g); return;
printf("total nodes=%d, g=%u \n", my.nodes, my.gfound);
case 'r': fZ(fI(n),g); fZ(fE(n),g); return;
const char *pr = {"Found.."}; // for g++
case 'u': fZ(fE(n),g); fZ(fL(n),g); return;
print_node( &work,pr,1 );
default : fZ(fL(n),g); fZ(fI(n),g); fZ(fE(n),g); return;}}
return FOUND;
case 3: switch(e){case 0: switch(l){case 'l': fZ(fG(n),g); return;
}
case 'd': fZ(fE(n),g); return;
NODE_T news;
default : fZ(fE(n),g); fZ(fG(n),g); return;}
// Sort successor nodes so that the lowest heuristic is visited
case 3: switch(l){case 'r': fZ(fG(n),g); return;
// before the less promising at the same level. This reduces the
case 'd': fZ(fL(n),g); return;
// number of searches and finds more solutions
default : fZ(fL(n),g); fZ(fG(n),g); return;}
HSORT_T hlist[NDIRS];
default: switch(l){case 'l': fZ(fG(n),g); fZ(fL(n),g); return;
for( short i=0; i<NDIRS; i++ ){
case 'r': fZ(fG(n),g); fZ(fE(n),g); return;
u16t rv = make_node(pN,&news, i );
case 'd': fZ(fE(n),g); fZ(fL(n),g); return;
hlist[i].dn = i;
default : fZ(fL(n),g); fZ(fG(n),g); fZ(fE(n),g); return;}}
if( rv & OK ){
default: switch(e){case 0: switch(l){case 'l': fZ(fI(n),g); fZ(fG(n),g); return;
hlist[i].hn = news.h;
case 'u': fZ(fE(n),g); fZ(fG(n),g); return;
continue;
case 'd': fZ(fE(n),g); fZ(fI(n),g); return;
}
default : fZ(fE(n),g); fZ(fI(n),g); fZ(fG(n),g); return;}
hlist[i].hn = XX;
case 3: switch(l){case 'd': fZ(fI(n),g); fZ(fL(n),g); return;
}
case 'u': fZ(fL(n),g); fZ(fG(n),g); return;
sort_nodes(&hlist[0]);
case 'r': fZ(fI(n),g); fZ(fG(n),g); return;
default : fZ(fL(n),g); fZ(fI(n),g); fZ(fG(n),g); return;}
u16t temp, min = MAX_INT;
default: switch(l){case 'd': fZ(fI(n),g); fZ(fL(n),g); fZ(fE(n),g); return;
for( short i=0; i<NDIRS; i++ ){
case 'l': fZ(fI(n),g); fZ(fL(n),g); fZ(fG(n),g); return;
if( hlist[i].hn > 0xff ) continue;
case 'r': fZ(fI(n),g); fZ(fE(n),g); fZ(fG(n),g); return;
temp = make_node(pN,&news, hlist[i].dn );
case 'u': fZ(fE(n),g); fZ(fL(n),g); fZ(fG(n),g); return;
if( temp & XX ) return XX;
default : fZ(fL(n),g); fZ(fI(n),g); fZ(fE(n),g); fZ(fG(n),g); return;}}}
if( temp & OK ){
news.id = my.nodes++;
print_node(&news," succ",0 );
temp = search(&news, bound);
if(temp & 0xff00){ return temp;}
if(temp < min){ min = temp; }
}
}
return min;
}
void Solve(N n){for(int g{};;++g) fN(n,g);}
</lang>
 
/// \brief sort nodes to prioitize heuristic low
====The Task====
void sort_nodes(HSORT_T *p){
<lang cpp>
for( short s=0; s<NDIRS-1; s++ ){
int main (){
HSORT_T tmp = p[0];
N start(2,0,0xfe169b4c0a73d852,"",0);
if( p[1].hn < p[0].hn ){tmp=p[0]; p[0]=p[1]; p[1]=tmp; }
Solve(start);
if( p[2].hn < p[1].hn ){tmp=p[1]; p[1]=p[2]; p[2]=tmp; }
if( p[3].hn < p[2].hn ){tmp=p[2]; p[2]=p[3]; p[3]=tmp; }
}
}
 
</lang>
/// \brief return index of blank tile
u16t tile_home(NODE_T *pN ){
for( short i=0; i<NCELLS; i++ ){
if( pN->data[i] == 0 ) return i;
}
return XX;
}
 
/// \brief print node (or not) depending upon flags
void print_node( NODE_T *pN, const char *pMsg, short force ){
const int tp1 = 0;
if( my.verbose & BIT_HDR || force || tp1){
char ch = udlr_to_char(pN->udlr);
printf("id:%u src:%u; h=%d, g=%u, udlr=%c, %s\n",
pN->id, pN->src, pN->h, pN->g, ch, pMsg);
}
if(my.verbose & BIT_GRID || force || tp1){
for(u16t i=0; i<NR; i++ ){
for( u16t j=0; j<NC; j++ ){
printf("%3d",pN->data[i*NR+j]);
}
printf("\n");
}
printf("\n");
}
//putchar('>'); getchar();
}
 
/// \brief return true if selected tiles are settled
u16t goal_found(NODE_T *pN) {
if(my.phase==PHASE1){
short tags = 0;
for( short i=0; i<(NC); i++ ){
if( pN->data[i] == i+1 ) tags++;
}
if( tags==4 ) return 1; // Permutation starts with 1234
}
for( short i=0; i<(NR*NC); i++ ){
if( pN->data[i] != goal44.data[i] ) return 0;
}
return 1;
}
 
/// \brief convert UDLR index to printable char
char udlr_to_char( char udlr ){
char ch = '?';
switch(udlr){
case UP: ch = 'U'; break;
case DOWN: ch = 'D'; break;
case LEFT: ch = 'L'; break;
case RIGHT: ch = 'R'; break;
default: break;
}
return ch;
}
 
/// \brief convert 1-D array index to 2-D row-column
void idx_to_rc( u16t idx, u16t *row, u16t *col ){
*row = idx/NR; *col = abs( idx - (*row * NR));
}
 
/// \brief make successor node with blank tile moved UDRL
/// \return success or error
u16t make_node(NODE_T *pSrc, NODE_T *pNew, u8t udlr ){
u16t row,col,home_idx,idx2;
if(udlr>=NDIRS||udlr<0 ){ printf("invalid udlr %u\n",udlr); return XX; }
if(my.nodes > MAX_NODES ){ printf("excessive nodes %u\n",my.nodes);
return XX; }
memcpy(pNew,pSrc,sizeof(NODE_T));
home_idx = tile_home(pNew);
idx_to_rc(home_idx, &row, &col );
 
if( udlr == LEFT) { if( col < 1 ) return 0; col--; }
if( udlr == RIGHT ){ if( col >= (NC-1) ) return 0; col++; }
if( udlr == DOWN ) { if(row >= (NR-1)) return 0; row++; }
if( udlr == UP ){ if(row < 1) return 0; row--; }
idx2 = row * NR + col;
if( idx2 < NCELLS ){
u8t *p = &pNew->data[0];
p[home_idx] = p[idx2];
p[idx2] = 0; // swap
pNew->src = pSrc->id;
pNew->g = pSrc->g + 1;
pNew->h = taxi_dist(pNew);
pNew->udlr = udlr; // latest move;
return OK;
}
return 0;
}
 
/// \brief sum of 'manhattan taxi' distance between tile locations
u16t taxi_dist( NODE_T *pN){
u16t tile,sum = 0, r1,c1,r2,c2;
u8t *p44 = &pN->data[0];
for( short i=0; i<(NR*NC); i++ ){
tile = p44[i];
if( tile==0 ) continue;
idx_to_rc(i, &r2, &c2 );
idx_to_rc(tile-1, &r1, &c1 );
sum += abs(r1-r2) + abs(c1-c2);
}
}
return sum;
}
 
</syntaxhighlight>
{{out}}
<pre>
Phase1: IDA* search for 1234 permutation..
Solution found with 52 moves: rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd
id:1 src:0; h=36, g=0, udlr=?, Start
15 14 1 6
9 11 4 12
0 10 7 3
13 8 5 2
 
total nodes=838133, g=32
id:838132 src:838131; h=12, g=32, udlr=D, Found..
1 2 3 4
15 0 7 6
9 10 5 12
13 14 11 8
 
Phase2: IDA* search phase1 seed..
id:1 src:0; h=12, g=0, udlr=?, Start
1 2 3 4
15 0 7 6
9 10 5 12
13 14 11 8
 
total nodes=8598744, g=26
id:8598743 src:8598742; h=0, g=26, udlr=D, Found..
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 0
 
real 0m2.897s
user 0m2.887s
sys 0m0.008s
</pre>
===TimeLiterate to get ImperativeProgramming===
I think I used the same algorithm as Nigel Galloway, but I'm still not sure I understood his C++ code. For anyone who also had trouble understanding, I thoroughly explained how everything works in [http://kenogo.org/literate_programming/15_puzzle_solver.pdf this literate program].
 
The program takes about 12 seconds to solve the puzzle on my machine. I sacrificed efficiency for readability and extensibility.
 
=={{header|C sharp|C#}}==
{{incorrect|C sharp|The task presents a board which a solution must solve in 52 moves, there are no starting positions requiring 164 moves to solve. The required output is specified: "The output must show the moves' directions, like so: left, left, left, down, right... and so on.
There are two solutions, of fifty-two moves:
rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd
rrruldluuldrurdddluulurrrdlddruldluurddlulurruldrrdd }}
{{works with|C sharp|3+}}
<syntaxhighlight lang="csharp">using System;
using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using System.Text;
 
public static class Program
{
public static void Main(string[] args)
{
byte[] t = new byte[]
{
15, 14, 1, 6,
9, 11, 4, 12,
0, 10, 7, 3,
13, 8, 5, 2,
};
 
Ultimate.SolvePuzzle15(t);
}
}
 
public static class NativeLibraryHelper
{
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string DllToLoad);
 
[DllImport("kernel32.dll")]
public static extern IntPtr GetProcAddress(IntPtr DllHandle, string ProcedureName);
 
[DllImport("kernel32.dll")]
public static extern bool FreeLibrary(IntPtr DllHandle);
 
public static T GetMethod<T>(IntPtr DllHandle, string MethodName) where T : class
{
T Method = null;
 
IntPtr MethodHandle = NativeLibraryHelper.GetProcAddress(DllHandle, MethodName);
if (MethodHandle != IntPtr.Zero)
{
Method = (T)((Object)Marshal.GetDelegateForFunctionPointer(MethodHandle, typeof(T)));
}
 
return Method;
}
}
 
public static class Ultimate
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
private delegate string GetSolverName();
 
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
private delegate string CallSolver([In] [Out] byte[] Array, int Len);
 
public static void SolvePuzzle15(byte[] t)
{
string LibPath = "Solver.dll";
 
byte[] ZipedData = Convert.FromBase64String(Data.ToString());
byte[] UnzipedData = DecompressGZipArhive(new MemoryStream(ZipedData));
File.WriteAllBytes(LibPath, UnzipedData);
 
IntPtr DllHandle = NativeLibraryHelper.LoadLibrary(LibPath);
 
GetSolverName GetSolverName = NativeLibraryHelper.GetMethod<GetSolverName>(DllHandle, "GetSolverName");
Console.WriteLine("Hi! My name is {0}.", GetSolverName());
Console.WriteLine();
 
Console.WriteLine("And I try solve puzzle15 with board:");
for (int i = 0; i < t.Length; i += 4) Console.WriteLine("{0} {1} {2} {3}", t[i], t[i + 1], t[i + 2], t[i + 3]);
Console.WriteLine();
 
CallSolver SolveThis = NativeLibraryHelper.GetMethod<CallSolver>(DllHandle, "SolvePuzzle15");
 
DateTime StartTime = DateTime.Now;
string Path = SolveThis(t, t.Length);
 
if (!String.IsNullOrEmpty(Path))
{
Path = Path.Trim();
Console.WriteLine("Ready! Solution path is : {0}", Path);
Console.WriteLine("Moves {0} and Time: {1}", Path.Length, (DateTime.Now - StartTime).ToString());
Console.WriteLine();
Console.WriteLine("Bye bye :)");
}
else
{
Console.WriteLine("Sorry! I do know a solution :(");
}
 
NativeLibraryHelper.FreeLibrary(DllHandle);
File.Delete(LibPath);
 
Console.ReadKey();
}
 
private static byte[] DecompressGZipArhive(Stream FStream)
{
if (FStream == null) return new byte[0];
 
FStream.Seek(0, SeekOrigin.Begin);
MemoryStream OutStream = new MemoryStream();
 
using (GZipStream DecompressedStream = new GZipStream(FStream, CompressionMode.Decompress))
{
byte[] Buffer = new byte[1024];
int CountReadingBytes = 0;
 
while ((CountReadingBytes = DecompressedStream.Read(Buffer, 0, Buffer.Length)) > 0)
{
OutStream.Write(Buffer, 0, CountReadingBytes);
}
}
return OutStream.ToArray();
}
 
// no way make normal long string literal
private delegate StringBuilder AppendDelegate(string v);
private static StringBuilder Data = new StringBuilder(100000);
static Ultimate()
{
AppendDelegate a = Data.Append;
a("H4sICB6/w2MCAFBhc2NhbFNvbHZlci54ODYtNjQuZGxsAOxaZ3QbRRC+kyVHFg7nBAdCaDYYiKg21ab6ggR7cKL3HgJHDcWRqK");
a("5RDDof4on26I/OAx79QTDVkmwcOTTboTgxxYQm+yimOcYU8c2eZORLaP/xi253dmdnZmdnZmd3EzgxJhQIguDEL5MRhHbB+qsV");
a("/vmvGb/1t3hxfeHZojfL20X1zfKjzzl3UdnFdRedXTd/YdmC+RdeeFGw7IyzyupCF5ade2GZ77CjyhZedOZZO02f7qnI0jjcLw");
a("hnXl00he6osNOW6zkKNozf7hC6thGE448RhJINBXzww1cUsnWHJTfBztzgIWcO4PPi3Tn8/AqKKS1POYVzqLzHKRw+RZgC4avd");
a("8uC4Uzh9tvCf/8653ynMLvjr/p2CZ10eRIk5WwLdSZObilMmCKfvdOb84HzUoRfIDJy5JLNjCl4tyOxUR4jg6xGhE/QXo0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cJ4ub8lB4owsBobojuLpV");
a("Q1GBA6S2MC9eTFWzsBGi36/w6yft8YzQPkupModm/xRtStwIa+sB3HCPOu30naZ3VXs0xmzBaZf/UVH1GyjOck8V91aqgsMQZf");
a("7hW52/Lib9+g0UPTkNXWBGkN9Bm4KMu9iKfhBHIUCmA4iEb5zqrNnAM1IJM0UJ65rRmiHUmo/B4OSXGnAywfMBg4Zk1Jjybfh8");
a("VwtO8Sj8zccntmDqkwj41bN3IOlQFg9k0sP6rPNErT7rPFYrbpO5abl2+m2m+4+HdOQHJLK/lpqVpmbfiMIY70WJt1DiLSC8C9");
a("KQvl6m58v0XEEH7wvQSKZzm8QbUanj2RD0pXWZ2iX/osXNoMV89zICdJf0gOiJT09q/LgLAYr/6Rf8lSTIkho88j0BguLYhaxL");
a("USvWr1i8IVJfG65V8d+OFpxiRBXo2SZdRb6ENZpuL3qHPuvcZv3+EF5ES5RrclnUQs89g6m3gxHk7VakvN3z6x70qXtIn9dD+q");
a("we0ot6SM/qIT21h/RT62OmR9gT3mTEIExar41rPgK1zX58FunY1o0E1DBCXB0AK5WxkoKpKYyFca7dLb+WGOU/ub4Hffge0j09");
a("pM/qIb2oh/SsHtJTe0g/9WD36V/1kP7ugz3py7P/dV7Slel4InQJMsDHbjIv5wdi2IdWht5xF7TD8qHotGxwTif0KUj0W9gMka");
a("WZ7dPnHVlxoIsdbpkfJY4Vdo4UM+q3jndJgCBmM5MNyLmTzNoevuH6YFCvyvsRBCPq0776jPW568z1kfMtP4EpWUfyS96NDt1I");
a("4aePyjVWvKdTUrYgwWc2pj6L39j2xdXDZcEgT4FTjxoN1blE25PU0AYM9Y4vhJwhBymo20tloYXHM15J/RlINtgJreknenwfkd");
a("EuprpjRygfbacWAQV9iCn+wbKY1nil/tYbR/RqDFHPJtJK6kbE+eKwKF3L9qdPS38RXfW/avT8bitAD9dB/Xwa8vD6DrjFQMmS");
a("QJS+ibrvatL/A3KuyNwIGCNNDRymvnGa2zZUJP1RJDWQ/Eltpx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QXcAJPs2Rz+");
a("8XihRD5c1fgM6+0u6wqExMvpLv4dSGvGul+4QdOMiHGL7/y+Z2a8vGWiVBCgQH/jSbJEh5OKEsyA1oUzsvRcmCHLz8Zmj2WLz6");
a("TAIRomXglM5tFOODj+zD4JwNsEMK82tm8POT/h2Qqe1f1tM+307z/LleUPNteZ+WsrrQhBqrLECa/BfMs7+p2O1fvZbg/JdIf0");
a("a9RUHDJMcQMhZ+5mVf+fl1Qvf0blfdsyqWYS6obykvCnaXT3Q5XK81BtP+zD47loes2YKtUJO/biZ02mx+RTibNNX6amNwQOTc");
a("sNkGAKpF3OlGnAdxiCC9nnMLFZJO/DmQNHODFUlvuYJoqNk63gJhTZTMoWodr/ZG46d1aS8jTdgfwJrrXxvHNF8L1Hwlsues/W");
a("Uf+2oqa5d8Xunv9ny4vYsx/WGX/1LnvRaLLzhr+lnUBjDve5fbTm+Qfj7SfVc0uo+hgVM5jPRTkM4JO80V2Nabl152/8hWObUB");
a("FWPZ0dwv6a9reYWITak4q6uBOqO2J545ZfsO0VKIfTzdNEOjinjNmEciMkv3Q/MnkpMa8wrUXPINnzPnUVwqxSnfNJdQ3Hcv95");
a("p909xBcR8hLvzvrN9X447fCziKAkNVgnV+9iSen/fjp9vt37+U6L7BsmvGnVznckm5AzY3jyxkgjiUxAbIJKIjwbjDInBpWNBy");
a("kJNrdhGveFttTzQwGQtNO1MttJcvweg9/aZ1oR1ejo64XvBucz3h3RFZwYefKwaQv1UkaA/09korjBP5qLvDTLrj2/PEotyvP+");
a("ukmDEllDp+itOR791fQTTg6zMUaOMJtJE20G6+jGmAMiFifz+Sk74uMV4G26DOSnrX14+Ki54Kn8z8CH6dKajtGXJdJtbBkIo0");
a("/E0PDGH7u7vp0BwBL0A0oredZtozgusAe9m70md1GkCo21qFt97RwsKgkdnKQbDTm9OotVbxBPTNe6gnyv0AtSnY2Gnph53i2O");
a("v75y5V36vbEtXXv33hDWt6haGg1xHo194mAWFzEINT4InCVxxGjd+FoNHEWCR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bioGJLaC9/Zl7FNqG6REAs+");
a("BmJs0x3jRwAKSjbZD39dmNdkRYViTqaU9lJfPXUOvfqPXd1z5puYb516VptvPTE2+nyr//q6IUxfoak3YjyQmipdKsE63jc1zx");
a("r5e+js5wVGnQ1vvwNE+x1g1Nfe+L11TIz1RCuvyRuDLHcW76OZOQYT9weoJH0btttCh8HDHXLMHDpBjJmagtdNYwUPWcrSsDke");
a("pnGcFMkmnSjSO4xHzvNePhP0IztfiE+OlWH25IAk4QaEoZBFpsaiw1/RDPit9wnLT0+ZVFZ42kKaTxxWzEb9j95+5VhyYWZY+z");
a("18rmH86cWf/Adow9iPPtyR12q5stFe3Oow7fNPk/svQNpsbVSSbdWmIizpHXn7bksu3GJGEHcdhU0qMyJvf03yQcITDbKBH3N2");
a("gpRWkFKY14AG2YAKimpSi/xZ4hzJ02az7EyzNv4zGb8FJpuprcTmYbAAz6Df1LO4/ulo7fWp099Ie738aa29fj0qSns16Ht2Eu");
a("t7ZlKf9D29cpxJ1PdRdpT9mVj2pcLnnzOyAVi54WOcTHrexZEH7QzoDy8EaZ85PYqyDmcJ0oPXetVB5LWxjT9FpqdurKTn1Pz+");
a("0xORFjyQcA0GqujQln51JuC/xge3yLI9zxsr2zNqlBr/DvjIU9GviESlch+dVQkx/pzSr+xk4/zkqRicAUtCPbDlRCBcEB27/T");
a("17dvj8L9swl4v8ftVrNuz9KyYcjPkvFPux/Kah1brl7IEO71B8ObyjnRR2DDLNr05NkcnVqwaarJgGoYlVvIwK/qf5z0uG8YS4");
a("Xb2dKLoH7j+Vc3FmIIpuag06v6umT+VmJPFgU9kuqxehN2UI9/SwAvizCeuEwh8EoTxIRW88BFmFDE4FYgDKCxucoo9Nd/4GOF");
a("41J9LYZFzPaE6XB+udLqOMl8lt+B7h6GXSljG+Xsa1FmzYI/f1cWTrgSm1HzRleLqhD03skNOf5nN6jju96+Ic2L4duARaWXXC");
a("ddwdsJS9QsepQ+hUfWDQbXPktU/E8a8cDHN1A3HspgLNdn5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KhsXSpDdk/fNnvX9KvyMI+kQyDU+R7iBaBvRRANTIYScWlvfetrzCK+EQRyVA1fo2Yt+m4Wgls8LfXJTVm+GH");
a("E7Py/WWuoCrnsRNB6vvdUY01nUZCR/1MIhc0wxRLdPtO3h+xZLta9gQlcEHqEl+1xtrdaOgXEREvrWmyiVemz5Dsa9OnTBDEcy");
a("34EVpk5lYiotxbu1rzmEXs60PuhJmj1SNhUkJpAIB1o2OGeNHGCP2uXuhFyfz62o54GRW1yzth0iiH292KlwCtgrVvFBW/NqfN");
a("T935auXd/3N0HaOC4K5z8rmLWNxj4NitZK73VuUzAZKqtrs5VmCpXLjLdu7OIdJqJJmk40lYW1sD9CfDzkCziJx864svc508Vw");
a("0thIH9k2mz9a979++KfpLURayssm7wiWZpmSeyont6gN88Knng4Geah9ECi13Ad3/P306vrO77t2995G+D7FrG94HFyv8MN+V2");
a("/lMqujJGUj1+z4ABwbc5F4/Mo748pwH/3r8GrAFvEWWErNp37qg8RkSMT62SwRo30NNBzAdG4Lz+USQMAJU0WGdTGsfPmpIGSz");
a("XI8pb4sZl4W8Y3YYdGMh73chYNx+4YzuKuQcw/sls4394pig9U0Mq7xVtiG4Hog4r2Odz4qJ7IIWMa3Vxf17rYxhasvvPnNhaY");
a("uygqzv5f5EYUM2bhwbkevGGFVbHYrrgB18opJg2iUEkf4zoqcA0xpoUkVhsiPDBDojwgg6fS6ClQd7lEGcikPxinud1Pwn5sdR");
a("sW5vx3KmYN1GrPPQQLMMvg9b+DKRfmk4OZmKDHOEEeZySxgm0vtzWuJc00hP0m7c0VTtffl+DgSoOFWlt2mS6nbS3d98f7Fklx");
a("xmh8o8LVlvwbEjJn2fSTNMpOs7zKTp+lyQUlSDKar9KapxHFUshz99B4XvZwr/UkT4DL00FFUuk/Y3kd4ZQdpPHxkizeok0kNN");
a("pKczKcNoFpumB2nbIrG4kd8cV64NpIOQwEKMl7pobkcJ3XdeV1A+yU3NXbK6en2XKdZM8QDgDwikb/y2O/pBEfTZgn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a("rO32GCDq+xNjJrSVf4OUzWdW691hzqmDe6zn7RZW673lzpCl8x3lzpjBe8wWuHDvkiBDVv5wVvtN91dpN1NMG60hF3Yj2d84o3");
a("+zld4osQ6YwfRauu8e8YroNbfB/Era5DR7zjbc4HHfOxSHTCl6NDZzwbqa7zgbf73LrCt2CCrvKrqOo6r3mHedBlXrRqXekSj0");
a("CPrvAldzkrdMZP4Dud82fo1w1e4m7rRIe8BgY85mPyThikYz4Ky+iEL8LKOuO7sJau8QwM0XX+FE26wTve42zRMfegRVfutZcR");
a("64J3v89c6ZjvR7sueN37zZXOecQkZ46u8C0Yq6vch0w3+LYH7EFd5esednt1lR9/xP7SOS9Vs6d0yKfgc53wNDR0zos8Zk50yP");
a("dhwOPGyLs8bp3omN9BSRdcesI+0hyciGadcA0tmoPvMFw3eOku49UxX46ROuPfnvTaoYOn/H4Pqc55m6etBx3xAxiva7z8FOPV");
a("JT72GWeOTvioqT63TvhjTNEFh9Oc1zrkLTFLR7wf6rrCp6FHp3wdCl3lx9Gnc34TDV3wz/hDB93OKwRPuB7eDAN1xOMR6io/jp");
a("V1zm9iLV3wzxiig2d9HDTpEm+GZh3xfhimK3waWnXK12G4rvLjaNM5v4mRuuAlnzO3OuQ9MFrHfCtSXeVedOqCl3jevtNl7kJV");
a("5/w7Jusgd16iS0d8B7p1lb/CLN3gI6abW13hVWeYW13iZvyhI94fQZf34dMxUKd8PUJd5RcxWNf5M5R0gxd/wRmlQ14TZV3mnT");
a("FUx3wkIp3wC2jRdS7PtNc0B3ugQ8f8AlJd528wSTf46BetK53whejRGd+JQtd4Ovp0nT9BQzd4gZeMV4c8AcGTxsXTEeo6f4XB");
a("usGLvmyMOuRzsZ5O+VY06So/hmad81wM0wX/hFYdzPLnLwzXJd4UbTribLa1oTN+EKN0jV/DaF3nbzBGNzh61XmqIz4Mk3SFz0");
a("JNp3wjpugqT0Wucx47x6XojCehX9f42NecM7rKb2PQU66fz3vdeatTnoaSznnQG+ZBh9w51/3TGT+B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rDNENXrxizeuQN8");
a("JwXebRaNMpT0KnrvHCR5pnHfKe6NIxP4puXfCmR1ljOuKj0aMT3vBo169j7sKgV8wV92KwLvi5keZZ59yLWBf8F0bo4BjPZvKc");
a("gorOeC7G64LHHGf965QfRU3XuAfdOmj3e0vM1DGfhLpO+Cr06IzfRqELXut486zL3ImGzvghzNc1fhUDZlt73IdBusHTTnDO6I");
a("L/RkmXT/RvHLCezrkXQ3XB8SivIzrm7U/yY13hLU82Xh3xkejQCY9DqjPe+xTng465OXHPdMRHY4pO+EnkOudVT3WPdIkPR4+u");
a("8Gf4XDd45dP8vkJHPA0DXvVrec3TvY7rMqdYWaf8HIbonFccbVy6xHuiRcd8LmKd8cJnuKc65I3Qrst8wJn2u67weZioU97Qsw");
a("Lu0WXeC3N0zIt0uGc65IsxYI6Pz8+cbf51zr1o0gUn55gjnfAEjNJV/gGjdYMXP9e60iG/iYm64EFj7E0d8kuo6zpPOM9c6SpP");
a("xYDXfF7uxSBd8OoXuB5d5j3QomOejVjX+c3U9emC/0GHDi505iDVJd4OY3XET13stUDX+c9L3EcdXOpcRaE5OAR9usJXoqEzzv");
a("GHznn2Zc72130c3utya1XHfC6G6JRvR5Ou8pNo1jn3YpgueJ8rnCc65mMwVifchUznPBcTdcF/4x4djDNGTNYlbkaXjniJK+1f");
a("HfK2mKUjHo66rvCp6NEpX4tCV3kq+nTOl3Yau874L5Te8Hmv8iwVDNEV7sVQXfA6VxuXLvOZiHXKd6NN1/iYa5zvOuFxGKszfu");
a("9a49UFb3+dseiI17revOsy74F5Ov6fYrsMlSKKAyg+dhfYhYKFCDY2dtfY3S12K7aiomJ3C3aLLWI3drfPbjGx4zcfDucg+9y7");
a("996dh8KfV+Kp3sZnkfCSs+Ccc3zXdAGuMNf+65DXo6HexqfRVl/il+iqP3DKee6SjlwYQ3Q53o3R+jA/wQz9gTfOd4/1Nj6L4/");
a("oSf8Y5HZhXX7zQd02v4BNIeNlrOMki76dT8jmk15c49mJ7q1Py3mXWrw9zDAboyMFyz24deSDG69H8FzN0sMLzBKt0Nt6ATXob");
a("n8U1fYlbrLSfui3/QNwrftZsdyGk1OW4A9LrPnxprTugIw9f5+z0aF6GOXoFz17vrkbNCTa4hzolD8dpPZpf4pr+wG02+my6Lf");
a("/AWx1sspcIrnovLrjZenQ5bozMui33Rw49mnchnz7Mh7bZt6j5LzrqYLu/Y5dnl2az1H7f6ch7cEAf5soHvLcOuTuCa17Dh5FQ");
a("R/6KlDowJ93tsP3RfXgJ+ugV/PKI+6M/cOajzkJn4/zHnIUuwC1xTbflccedhZ7B25DwuvPifye8lw5O+n8S5NGX+Mcp33kdnP");
a("bsQiUduTVq6bY8Aw115DNoqS/xnTP2RMdw9bPujw65M2boPrwgQq/g/VihD/NSs8rr9ArejXv6MF/FUx3DH/FWB+f8ux5fdMhj");
a("ENywHj6PhPoSxznvOa9Tcl1k1iGPRx49gzeggN7GRy945uhLPP2i77KewUUuOV9djqdhiJ7BGzBeb+MGZpGn6rb8HAf0B65yxf");
a("3UIa/BNb2NzyJGX+In15yr/sAZrjuXm86UVyG93sZ3kEfHcJUb1qxDbn7Teem2vA8t9WGOQVcdOc4t90en5LMYoi9xrtvOQhfg");
a("GlilQ/6HTTq44/uOazobX8U9HcPBXd/rW17DOZFUF+AaSK9Dvo9sOoajed9yOnJGVNPZuDtC3YcnY4CewTcxXMdwx/vuie7D17");
a("BNx3C9B55lui33wnHdhxfhnF7B0YzuNR35JOLe9tk5eYx91il55CNr1qO56GNr0+W4KxrqPjwDLXXkHeioD3MMeujIwRPr15Gz");
a("YbiOXA7jdeTmmKrbcoKnnm86JVfEXh3yNBzWM7jWM/dHh3zlt2eljuHgjzXficPeK0JHLoc8OoY/ooAO/rrDKK7L8V2U0zH8Ew");
a("118M/nRksdcneM1n34JCbpSzwyMJejR/MyHNcr+A/OaQO1QTbc0pGvIEbHcIrYZpl0Si6LD7oc/8J3Hc3SZkRw189y6rjmHaLm");
a("TSitt/F9hDqGf6KpjgZbq8Y3d6FDn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spjd5JBm4WtKbiaosXIe");
a("culJrhZrwtqwbmwAG8WmsHlsFduOLDrCzrMSJdAg0DHLX4D82eWnkDxX/OvooW/9OqCjZ9AfVMwJFoIGJ/DROW8HD5E3zfKtsM");
a("eG58eAg2X5tdD/YP44dH+af42c6VToAb1nFOYhXfYUMlD7ZuEuV3luSDvH/6vFag5th1mjoelSaw009a0DVpG2lW63tNtBz5H2");
a("eOgIDaHfGfsydtQL+71tJLskeyE/piZnQjmoBsUuJ69BqzqphlBoYGoYttPy1DrspKOps1Ao7LSFGmOcCdBhvbMVbfCkcwE58d");
a("L5gBbYPd0HaixIL4UKJ9LnkQu4YDD77pm+mPvUzCz0v9HeBLh1tbcJPuU/SAppY/GFDUBOnay4lHVW22/gG+TDmL8e6X6MXr6b");
a("wnWjgknCaZz5kNYUX9iQlGM8tbT/n3/68xHeVZKEADYEAA==");
}
}</syntaxhighlight>
{{out}}
<pre>
Hi! My name is Pascal Slover.
 
And I try solve puzzle15 with board:
15 14 1 6
9 11 4 12
0 10 7 3
13 8 5 2
 
Ready! Solution path is : rrruldluuldrurdddluulurrrdlddruldluurddlulurruldrrdd
Moves 52 and Time: 00:00:00.7509766
 
Bye bye :)
</pre>
 
=={{header|C++}}==
[http://www.rosettacode.org/wiki/15_puzzle_solver/20_Random see] for an analysis of 20 randomly generated 15 puzzles solved with this solver.
====The Solver====
<langsyntaxhighlight lang="cpp">
// Solve Random 15 Puzzles : Nigel Galloway - October 18th., 2017
class fifteenSolver{
const int Nr[16]{3,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3}, Nc[16]{3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2}, i{1}, g{8}, e{2}, l{4};
int n{},_n{}, N0[85100]{},N3[85100]{},N4[85100]{};
unsigned long N2[85100]{};
const bool fY(){
if (N2N4[n]==0x123456789abcdef0<_n) return truefN();
if (N2[n]==0x123456789abcdef0) {std::cout<<"Solution found in "<<n<<" moves :"; for (int g{1};g<=n;++g) std::cout<<(char)N3[g]; std::cout<<std::endl; return true;};
if (N4[n]<=_n) return fN();
if (N4[n]==_n) return fN(); else return false;
}
const bool fZ(const int w fN(){
if ((wN3[n]!='u' &i)>0& N0[n]/4<3){fI(); ++n; if (fY()) return true; --n;}
if ((wN3[n]!='d' &g)& N0[n]/4>0){fG(); ++n; if (fY()) return true; --n;}
if ((wN3[n]!='l' &e)>0& N0[n]%4<3){fE(); ++n; if (fY()) return true; --n;}
if ((wN3[n]!='r' &l)& N0[n]%4>0){fL(); ++n; if (fY()) return true; --n;}
return false;
}
const bool fN(){
switch(N0[n]){case 0: switch(N3[n]){case 'l': return fZ(i);
case 'u': return fZ(e);
default : return fZ(i+e);}
case 3: switch(N3[n]){case 'r': return fZ(i);
case 'u': return fZ(l);
default : return fZ(i+l);}
case 1: case 2: switch(N3[n]){case 'l': return fZ(i+l);
case 'r': return fZ(i+e);
case 'u': return fZ(e+l);
default : return fZ(l+e+i);}
case 12: switch(N3[n]){case 'l': return fZ(g);
case 'd': return fZ(e);
default : return fZ(e+g);}
case 15: switch(N3[n]){case 'r': return fZ(g);
case 'd': return fZ(l);
default : return fZ(g+l);}
case 13: case 14: switch(N3[n]){case 'l': return fZ(g+l);
case 'r': return fZ(e+g);
case 'd': return fZ(e+l);
default : return fZ(g+e+l);}
case 4: case 8: switch(N3[n]){case 'l': return fZ(i+g);
case 'u': return fZ(g+e);
case 'd': return fZ(i+e);
default : return fZ(i+g+e);}
case 7: case 11: switch(N3[n]){case 'd': return fZ(i+l);
case 'u': return fZ(g+l);
case 'r': return fZ(i+g);
default : return fZ(i+g+l);}
default: switch(N3[n]){case 'd': return fZ(i+e+l);
case 'l': return fZ(i+g+l);
case 'r': return fZ(i+g+e);
case 'u': return fZ(g+e+l);
default : return fZ(i+g+e+l);}}
}
void fI(){
const int g = (11-N0[n])*4;
const unsigned long a = N2[n]&((unsigned long)15<<g);
N0[n+1]=N0[n]+4; N2[n+1]=N2[n]-a+(a<<16); N3[n+1]='d'; N4[n+1]=N4[n]+(Nr[a>>g]<=N0[n++]/4?0:1);
}
void fG(){
const int g = (19-N0[n])*4;
const unsigned long a = N2[n]&((unsigned long)15<<g);
N0[n+1]=N0[n]-4; N2[n+1]=N2[n]-a+(a>>16); N3[n+1]='u'; N4[n+1]=N4[n]+(Nr[a>>g]>=N0[n++]/4?0:1);
}
void fE(){
const int g = (14-N0[n])*4;
const unsigned long a = N2[n]&((unsigned long)15<<g);
N0[n+1]=N0[n]+1; N2[n+1]=N2[n]-a+(a<<4); N3[n+1]='r'; N4[n+1]=N4[n]+(Nc[a>>g]<=N0[n++]%4?0:1);
}
void fL(){
const int g = (16-N0[n])*4;
const unsigned long a = N2[n]&((unsigned long)15<<g);
N0[n+1]=N0[n]-1; N2[n+1]=N2[n]-a+(a>>4); N3[n+1]='l'; N4[n+1]=N4[n]+(Nc[a>>g]>=N0[n++]%4?0:1);
}
public:
fifteenSolver(int n, unsigned long g){N0[0]=n; N2[0]=g; N4[0]=0;}
void Solve(){for(;not fY();++_n);}
if (fN()) {std::cout<<"Solution found in "<<n<<" moves: "; for (int g{1};g<=n;++g) std::cout<<(char)N3[g]; std::cout<<std::endl;}
else {n=0; ++_n; Solve();}
}
};
</syntaxhighlight>
</lang>
 
====The Task====
<langsyntaxhighlight lang="cpp">
int main (){
fifteenSolver start(8,0xfe169b4c0a73d852);
start.Solve();
}
</syntaxhighlight>
</lang>
{{out}}
<pre>
Solution found in 52 moves: rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd
 
real 0m0.795s517s
user 0m0.794s
sys 0m0.000s
</pre>
 
====Extra Credit====
<syntaxhighlight lang="cpp">
I have updated the 20 random examples, which showed n the number of moves to include _n. As seen when _n is less than 10 the puzzle is solved quickly. This suggests a multi-threading strategy. I have 8 cores available. Modifying solve so that it starts a thread for _n=0 to _n=9, 1 for _n=10, 1 for _n=11, 1 for _n=12, and 1 for _n=13 tests that the fan is still working and turns the computer into a hair-dryer. It also finds the following solution to the extra credit task:
int main (){
fifteenSolver start(0,0x0c9dfbae37254861);
start.Solve();
}
</syntaxhighlight>
{{out}}
<pre>
Solution found in 80 moves :dddrurdruuulllddrulddrrruuullddruulldddrrurulldrruulldlddrurullddrrruullulddrdrr
 
real 249m18.464s
</pre>
 
=={{header|Common Lisp}}==
 
{{trans|Racket}}
 
Using an A* search algorithm which is good enough for the first task. I increased SBCL's dynamic memory to 2GB for the code to run smoothly.
 
<syntaxhighlight lang="lisp">;;; Using a priority queue for the A* search
(eval-when (:load-toplevel :compile-toplevel :execute)
(ql:quickload "pileup"))
 
;; * The package definition
(defpackage :15-solver
(:use :common-lisp :pileup)
(:export "15-puzzle-solver" "*initial-state*" "*goal-state*"))
(in-package :15-solver)
 
;; * Data types
(defstruct (posn (:constructor posn))
"A posn is a pair struct containing two integer for the row/col indices."
(row 0 :type fixnum)
(col 0 :type fixnum))
 
(defstruct (state (:constructor state))
"A state contains a vector and a posn describing the position of the empty slot."
(matrix '#(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0) :type simple-vector)
(empty-slot (posn :row 3 :col 3) :type posn))
(defparameter directions '(up down left right)
"The possible directions shifting the empty slot.")
(defstruct (node (:constructor node))
"A node contains a state, a reference to the previous node, a g value (actual
costs until this node, and a f value (g value + heuristics)."
(state (state) :type state)
(prev nil)
(cost 0 :type fixnum)
(f-value 0 :type fixnum))
 
;; * Some constants
(defparameter *side-size* 4 "The size of the puzzle.")
 
(defvar *initial-state*
(state :matrix #(15 14 1 6
9 11 4 12
0 10 7 3
13 8 5 2)
:empty-slot (posn :row 2 :col 0)))
 
(defvar *initial-state-2*
(state :matrix #( 0 12 9 13
15 11 10 14
3 7 2 5
4 8 6 1)
:empty-slot (posn :row 0 :col 0)))
 
(defvar *goal-state*
(state :matrix #( 1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 0)
:empty-slot (posn :row 3 :col 3)))
 
;; * The functions
 
;; ** Accessing the elements of the puzzle
(defun matrix-ref (matrix row col)
"Matrices are simple vectors, abstracted by following functions."
(svref matrix (+ (* row *side-size*) col)))
 
(defun (setf matrix-ref) (val matrix row col)
(setf (svref matrix (+ (* row *side-size*) col)) val))
 
;; ** The final predicate
(defun target-state-p (state goal-state)
"Returns T if STATE is the goal state."
(equalp state goal-state))
 
(defun valid-movement-p (direction empty-slot)
"Returns T if direction is allowed for the current empty slot position."
(case direction
(up (< (posn-row empty-slot) (1- *side-size*)))
(down (> (posn-row empty-slot) 0))
(left (< (posn-col empty-slot) (1- *side-size*)))
(right (> (posn-col empty-slot) 0))))
 
;; ** Pretty print the state
(defun print-state (state)
"Helper function to pretty-print a state."
(format t " ====================~%")
(loop
with matrix = (state-matrix state)
for i from 0 below *side-size*
do
(loop
for j from 0 below *side-size*
do (format t "| ~2,D " (matrix-ref matrix i j)))
(format t " |~%"))
(format t " ====================~%"))
 
;; ** Move the empty slot
(defun move (state direction)
"Returns a new state after moving STATE's empty-slot in DIRECTION assuming a
valid direction."
(let* ((matrix (copy-seq (state-matrix state)))
(empty-slot (state-empty-slot state))
(r (posn-row empty-slot))
(c (posn-col empty-slot))
(new-empty-slot
(ccase direction
(up (setf (matrix-ref matrix r c) (matrix-ref matrix (1+ r) c)
(matrix-ref matrix (1+ r) c) 0)
(posn :row (1+ r) :col c))
(down (setf (matrix-ref matrix r c) (matrix-ref matrix (1- r) c)
(matrix-ref matrix (1- r) c) 0)
(posn :row (1- r) :col c))
(left (setf (matrix-ref matrix r c) (matrix-ref matrix r (1+ c))
(matrix-ref matrix r (1+ c)) 0)
(posn :row r :col (1+ c)))
(right (setf (matrix-ref matrix r c) (matrix-ref matrix r (1- c))
(matrix-ref matrix r (1- c)) 0)
(posn :row r :col (1- c))))))
(state :matrix matrix :empty-slot new-empty-slot)))
 
;; ** The heuristics
(defun l1-distance (posn0 posn1)
"Returns the L1 distance between two positions."
(+ (abs (- (posn-row posn0) (posn-row posn1)))
(abs (- (posn-col posn0) (posn-col posn1)))))
 
(defun element-cost (val current-posn)
"Returns the L1 distance between the current position and the goal-position
for VAL."
(if (zerop val)
(l1-distance current-posn (posn :row 3 :col 3))
(multiple-value-bind (target-row target-col)
(floor (1- val) *side-size*)
(l1-distance current-posn (posn :row target-row :col target-col)))))
 
(defun distance-to-goal (state)
"Returns the L1 distance from STATE to the goal state."
(loop
with matrix = (state-matrix state)
with sum = 0
for i below *side-size*
do (loop
for j below *side-size*
for val = (matrix-ref matrix i j)
for cost = (element-cost val (posn :row i :col j))
unless (zerop val)
do (incf sum cost))
finally (return sum)))
 
(defun out-of-order-values (list)
"Returns the number of values out of order."
(flet ((count-values (list)
(loop
with a = (first list)
with rest = (rest list)
for b in rest
when (> b a)
count b)))
(loop
for candidates = list then (rest candidates)
while candidates
summing (count-values candidates) into result
finally (return (* 2 result)))))
 
(defun row-conflicts (row state0 state1)
"Returns the number of conflicts in the given row, i.e. value in the right row
but in the wrong order. For each conflicted pair add 2 to the value, but a
maximum of 6 to avoid over-estimation."
(let* ((goal-row (loop
with matrix1 = (state-matrix state1)
for j below *side-size*
collect (matrix-ref matrix1 row j)))
(in-goal-row (loop
with matrix0 = (state-matrix state0)
for j below *side-size*
for val = (matrix-ref matrix0 row j)
when (member val goal-row)
collect val)))
(min 6 (out-of-order-values
;; 0 does not lead to a linear conflict
(remove 0 (nreverse in-goal-row))))))
 
(defun col-conflicts (col state0 state1)
"Returns the number of conflicts in the given column, i.e. value in the right
row but in the wrong order. For each conflicted pair add 2 to the value, but a
maximum of 6 to avoid over-estimation."
(let* ((goal-col (loop
with matrix1 = (state-matrix state1)
for i below *side-size*
collect (matrix-ref matrix1 i col)))
(in-goal-col (loop
with matrix0 = (state-matrix state0)
for i below *side-size*
for val = (matrix-ref matrix0 i col)
when (member val goal-col)
collect val)))
(min 6 (out-of-order-values
;; 0 does not lead to a linear conflict
(remove 0 (nreverse in-goal-col))))))
 
(defun linear-conflicts (state0 state1)
"Returns the linear conflicts for state1 with respect to state0."
(loop
for i below *side-size*
for row-conflicts = (row-conflicts i state0 state1)
for col-conflicts = (col-conflicts i state0 state1)
summing row-conflicts into all-row-conflicts
summing col-conflicts into all-col-conflicts
finally (return (+ all-row-conflicts all-col-conflicts))))
 
(defun state-heuristics (state)
"Using the L1 distance and the number of linear conflicts as heuristics."
(+ (distance-to-goal state)
(linear-conflicts state *goal-state*)))
 
;; ** Generate the next possible states.
(defun next-state-dir-pairs (current-node)
"Returns a list of pairs containing the next states and the direction for the
movement of the empty slot."
(let* ((state (node-state current-node))
(empty-slot (state-empty-slot state))
(valid-movements (remove-if-not (lambda (dir) (valid-movement-p dir empty-slot))
directions)))
(map 'list (lambda (dir) (cons (move state dir) dir)) valid-movements)))
 
;; ** Searching the shortest paths and reconstructing the movements
(defun reconstruct-movements (leaf-node)
"Traverse all nodes until the initial state and return a list of symbols
describing the path."
(labels ((posn-diff (p0 p1)
;; Compute a pair describing the last move
(posn :row (- (posn-row p1) (posn-row p0))
:col (- (posn-col p1) (posn-col p0))))
(find-movement (prev-state state)
;; Describe the last movement of the empty slot with R, L, U or D.
(let* ((prev-empty-slot (state-empty-slot prev-state))
(this-empty-slot (state-empty-slot state))
(delta (posn-diff prev-empty-slot this-empty-slot)))
(cond ((equalp delta (posn :row 1 :col 0)) 'u)
((equalp delta (posn :row -1 :col 0)) 'd)
((equalp delta (posn :row 0 :col 1)) 'l)
((equalp delta (posn :row 0 :col -1)) 'r))))
(iter (node path)
(if (or (not node) (not (node-prev node)))
path
(iter (node-prev node)
(cons (find-movement (node-state node)
(node-state (node-prev node)))
path)))))
(iter leaf-node '())))
 
(defun A* (initial-state
&key (goal-state *goal-state*) (heuristics #'state-heuristics)
(information 0))
"An A* search for the shortest path to *GOAL-STATE*"
(let ((visited (make-hash-table :test #'equalp))) ; All states visited so far
;; Some internal helper functions
(flet ((pick-next-node (queue)
;; Get the next node from the queue
(heap-pop queue))
(expand-node (node queue)
;; Expand the next possible nodes from node and add them to the
;; queue if not already visited.
(loop
with costs = (node-cost node)
with successors = (next-state-dir-pairs node)
for (state . dir) in successors
for succ-cost = (1+ costs)
for f-value = (+ succ-cost (funcall heuristics state))
;; Check if this state was already looked at
unless (gethash state visited)
do
;; Insert the next node into the queue
(heap-insert
(node :state state :prev node :cost succ-cost
:f-value f-value)
queue))))
;; The actual A* search
(loop
;; The priority queue
with queue = (make-heap #'<= :name "queue" :size 1000 :key #'node-f-value)
with initial-state-cost = (funcall heuristics initial-state)
initially (heap-insert (node :state initial-state :prev nil :cost 0
:f-value initial-state-cost)
queue)
for counter from 1
for current-node = (pick-next-node queue)
for current-state = (node-state current-node)
;; Output some information each counter or nothing if information
;; equals 0.
when (and (not (zerop information))
(zerop (mod counter information)))
do (format t "~Dth State, heap size: ~D, current costs: ~D~%"
counter (heap-count queue)
(node-cost current-node))
;; If the target is not reached continue
until (target-state-p current-state goal-state)
do
;; Add the current state to the hash of visited states
(setf (gethash current-state visited) t)
;; Expand the current node and continue
(expand-node current-node queue)
finally (return (values (reconstruct-movements current-node) counter))))))
 
;; ** Pretty print the path
(defun print-path (path)
"Prints the directions of PATH and its length."
(format t "~{~A~} ~D moves~%" path (length path)))
 
;; ** Get some timing information
(defmacro timing (&body forms)
"Return both how much real time was spend in body and its result"
(let ((start (gensym))
(end (gensym))
(result (gensym)))
`(let* ((,start (get-internal-real-time))
(,result (progn ,@forms))
(,end (get-internal-real-time)))
(values ,result (/ (- ,end ,start) internal-time-units-per-second)))))
 
;; ** The main function
(defun 15-puzzle-solver (initial-state &key (goal-state *goal-state*))
"Solves a given and valid 15 puzzle and returns the shortest path to reach the
goal state."
(print-state initial-state)
(multiple-value-bind (result time)
(timing (multiple-value-bind (path steps)
(a* initial-state :goal-state goal-state)
(print-path path)
steps))
(format t "Found the shortest path in ~D steps and ~3,2F seconds~%" result time))
(print-state goal-state))
</syntaxhighlight>
 
{{out}}
<pre>15-SOLVER> (15-puzzle-solver *initial-state*)
====================
| 15 | 14 | 1 | 6 |
| 9 | 11 | 4 | 12 |
| 0 | 10 | 7 | 3 |
| 13 | 8 | 5 | 2 |
====================
RRRULDDLUUULDRURDDDRULLULURRRDDLDLUURDDLULURRULDRDRD 52 moves
Found the shortest path in 1130063 steps and 17.61 seconds
====================
| 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 0 |
====================</pre>
=={{header|F_Sharp|F#}}==
===The Function===
<syntaxhighlight lang="fsharp">
// A Naive 15 puzzle solver using no memory. Nigel Galloway: October 6th., 2017
let Nr,Nc = [|3;0;0;0;0;1;1;1;1;2;2;2;2;3;3;3|],[|3;0;1;2;3;0;1;2;3;0;1;2;3;0;1;2|]
type G= |N |I |G |E |L
type N={i:uint64;g:G list;e:int;l:int}
let fN n=let g=(11-n.e)*4 in let a=n.i&&&(15UL<<<g)
{i=n.i-a+(a<<<16);g=N::n.g;e=n.e+4;l=n.l+(if Nr.[int(a>>>g)]<=n.e/4 then 0 else 1)}
let fI i=let g=(19-i.e)*4 in let a=i.i&&&(15UL<<<g)
{i=i.i-a+(a>>>16);g=I::i.g;e=i.e-4;l=i.l+(if Nr.[int(a>>>g)]>=i.e/4 then 0 else 1)}
let fG g=let l=(14-g.e)*4 in let a=g.i&&&(15UL<<<l)
{i=g.i-a+(a<<<4) ;g=G::g.g;e=g.e+1;l=g.l+(if Nc.[int(a>>>l)]<=g.e%4 then 0 else 1)}
let fE e=let l=(16-e.e)*4 in let a=e.i&&&(15UL<<<l)
{i=e.i-a+(a>>>4) ;g=E::e.g;e=e.e-1;l=e.l+(if Nc.[int(a>>>l)]>=e.e%4 then 0 else 1)}
let fL=let l=[|[I;E];[I;G;E];[I;G;E];[I;G];[N;I;E];[N;I;G;E];[N;I;G;E];[N;I;G];[N;I;E];[N;I;G;E];[N;I;G;E];[N;I;G];[N;E];[N;G;E];[N;G;E];[N;G];|]
(fun n g->List.except [g] l.[n] |> List.map(fun n->match n with N->fI |I->fN |G->fE |E->fG))
let solve n g l=let rec solve n=match n with // n is board, g is pos of 0, l is max depth
|n when n.i =0x123456789abcdef0UL->Some(n.g)
|n when n.l>l ->None
|g->let rec fN=function h::t->match solve h with None->fN t |n->n
|_->None
fN (fL g.e (List.head n.g)|>List.map(fun n->n g))
solve {i=n;g=[L];e=g;l=0}
let n = Seq.collect fN n
</syntaxhighlight>
===The Task===
<syntaxhighlight lang="fsharp">
let test n g=match [1..15]|>Seq.tryPick(solve n g) with
Some n->n|>List.rev|>List.iter(fun n->printf "%c" (match n with N->'d'|I->'u'|G->'r'|E->'l'|L->'\u0000'));printfn " (%n moves)" (List.length n)
|_ ->printfn "No solution found"
test 0xfe169b4c0a73d852UL 8
</syntaxhighlight>
{{out}}
<pre>
rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd (52 moves)
</pre>
 
=={{header|Forth}}==
The idea is taken from C++ or F# version above.
 
The code was tested with gforth 0.7.3. It required a 64-bit system.
<syntaxhighlight lang="forth">
#! /usr/bin/gforth
 
cell 8 <> [if] s" 64-bit system required" exception throw [then]
 
\ In the stack comments below,
\ "h" stands for the hole position (0..15),
\ "s" for a 64-bit integer representing a board state,
\ "t" a tile value (0..15, 0 is the hole),
\ "b" for a bit offset of a position within a state,
\ "m" for a masked value (4 bits selected out of a 64-bit state),
\ "w" for a weight of a current path,
\ "d" for a direction constant (0..3)
 
\ Utility
: 3dup 2 pick 2 pick 2 pick ;
: 4dup 2over 2over ;
: shift dup 0 > if lshift else negate rshift then ;
 
hex 123456789abcdef0 decimal constant solution
: row 2 rshift ; : col 3 and ;
 
: up-valid? ( h -- f ) row 0 > ;
: down-valid? ( h -- f ) row 3 < ;
: left-valid? ( h -- f ) col 0 > ;
: right-valid? ( h -- f ) col 3 < ;
 
: up-cost ( h t -- 0|1 ) 1 - row swap row < 1 and ;
: down-cost ( h t -- 0|1 ) 1 - row swap row > 1 and ;
: left-cost ( h t -- 0|1 ) 1 - col swap col < 1 and ;
: right-cost ( h t -- 0|1 ) 1 - col swap col > 1 and ;
 
\ To iterate over all possible directions, put direction-related functions into arrays:
: ith ( u addr -- w ) swap cells + @ ;
create valid? ' up-valid? , ' left-valid? , ' right-valid? , ' down-valid? , does> ith execute ;
create cost ' up-cost , ' left-cost , ' right-cost , ' down-cost , does> ith execute ;
create step -4 , -1 , 1 , 4 , does> ith ;
 
\ Advance from a single state to another:
: bits ( h -- b ) 15 swap - 4 * ;
: tile ( s b -- t ) rshift 15 and ;
: new-state ( s h d -- s' ) step dup >r + bits 2dup tile ( s b t ) swap lshift tuck - swap r> 4 * shift + ;
: new-weight ( w s h d -- w' ) >r tuck r@ step + bits tile r> cost + ;
: advance ( w s h d -- w s h w' s' h' ) 4dup new-weight >r 3dup new-state >r step over + 2r> rot ;
 
\ Print a solution:
: rollback 2drop drop ;
: .dir ( u -- ) s" d..r.l..u" drop 4 + swap + c@ emit ;
: .dirs ( .. -- ) 0 begin >r 3 pick -1 <> while 3 pick over - .dir rollback r> 1+ repeat r> ;
: win cr ." solved (read right-to-left!): " .dirs ." - " . ." moves" bye ;
 
\ The main recursive function for depth-first search:
create limit 1 , : deeper 1 limit +! ;
: u-turn ( .. h2 w1 s1 h1 ) 4 pick 2 pick - ;
: search ( .. h2 w1 s1 h1 )
over solution = if win then
2 pick limit @ > if exit then
4 0 do dup i valid? if i step u-turn <> if i advance recurse rollback then then loop ;
 
\ Iterative-deepening search:
: solve 1 limit ! begin search deeper again ;
 
\ -1 0 hex 0c9dfbae37254861 decimal 0 solve \ uhm.
-1 0 hex fe169b4c0a73d852 decimal 8 solve \ the 52 moves case
\ -1 0 hex 123456789afbde0c decimal 14 solve \ some trivial case, 3 moves
bye
</syntaxhighlight>
 
{{out}}
<pre>
time ./15_puzzle_solver.fs
Solution found in 80 moves: dddrurdruuulllddrulddrrruuullddruulldddrrurulldrruulldlddrurullddrrruullulddrdrr
redefined search
solved (read right-to-left!): ddrrdlurrululddruuldlurddldrrruluuldddrurdluuldlurrr - 52 moves
real 1m14.605s
user 1m5.212s
sys 0m0.048s
</pre>
in 29m19.973s.<br>
It also solves the 5th. example which requires 29.3s single threaded in 7s.
 
=={{header|Fortran}}==
Line 316 ⟶ 4,777:
(The source below has the ABS outside the MOD: I don't care [[Talk:Carmichael_3_strong_pseudoprimes|what sort of mod]] is used here, just that negative numbers be as scrambled as positive) In both cases the array indexing is checkable by the compiler at compile time so that there need be no run-time checking on that. Such bound checking may be not as strict as might be expected when EQUIVALENCE tricks are involved. In tests with a variant board size of 3x4, the board position array was declared BOARD(N) where N = 12, but was still equivalenced to BORED(4) and so still allowed room for sixteen elements in BOARD. Subroutine UNPACK was not written to deal with anything other than a 4x4 board and so accessed elements 13, 14, 15, and 16 of BOARD that were outside its declared upper bound of 12, but no run-time objection was made. Similarly with a 3x3 board.
 
Granted a flexible pre-processor scheme (as in pl/i, say) one could imagine a menu of tricks being selected from according to the board shape specified, but without such a facility, the constants are merely named rather than literal. Any change, such as to a 3x4 board, can be made by adjusting the appropriate PARAMETER and many usages will adjust accordingly. Others will require adjustment by the diligent programmer for good results. In the absence of a pre-processor one could present the various possible code sequences surrounded by tests as in <langsyntaxhighlight Fortranlang="fortran">IF (NR.EQ.4) THEN
code specialised for NR = 4
ELSE IF (NR.EQ.3) THEN
code specialised for NR = 3
END IF</langsyntaxhighlight>
and hope that the compiler would carry forward the actual value of <code>NR</code> into the IF-statement's conditional expression, recognise that the result is also constant (for the current compilation with a particular value of <code>NR</code>) and so generate code only for the case that the expression came out as ''true'', without any test to select this being employed in the compiled code. This soon becomes a tangle of combinations, and has not been attempted. And there could be difficulties too. One wonders if, say, with NR = 3, the specialised code for the NR = 4 case could contain a mention of element 4 of an array which is actually of size NR. Would the compiler regard this as an error, given that it will be discarding this code anyway? Even if one used NR rather than a literal such as 4 there could still be problems, such as code calling for a division by (NR - 3).
 
Line 328 ⟶ 4,789:
 
===Source===
<langsyntaxhighlight Fortranlang="fortran"> SUBROUTINE PROUST(T) !Remembrance of time passed.
DOUBLE PRECISION T !The time, in seconds. Positive only, please.
DOUBLE PRECISION S !A copy I can mess with.
Line 856 ⟶ 5,317:
CALL PURPLE HAZE(FNAME(1:14))
 
END</langsyntaxhighlight>
 
===The Results===
Line 1,595 ⟶ 6,056:
 
Thus, for a 3x3 board the greatest separation is thirty-two steps to two positions, while the 3x4 and 4x3 boards both have eighteen positions fifty-two steps away from ZERO.
 
=={{header|F_Sharp|F#}}==
<lang fsharp>
// A Naive 15 puzzle solver using no memory. Nigel Galloway: October 6th., 2017
let Nr = [|3;0;0;0;0;1;1;1;1;2;2;2;2;3;3;3|]
let Nc = [|3;0;1;2;3;0;1;2;3;0;1;2;3;0;1;2|]
let rec Solve n =
let rec fN (i,g,e,l,_) = seq {
let fI = let n = (11-g-i*4)*4
let a = (e&&&(15UL<<<n))
(i+1,g,e-a+(a<<<16),'d'::l,Nr.[(int (a>>>n))] <= i)
let fG = let n = (19-g-i*4)*4
let a = (e&&&(15UL<<<n))
(i-1,g,e-a+(a>>>16),'u'::l,Nr.[(int (a>>>n))] >= i)
let fE = let n = (14-g-i*4)*4
let a = (e&&&(15UL<<<n))
(i,g+1,e-a+(a<<<4), 'r'::l,Nc.[(int (a>>>n))] <= g)
let fL = let n = (16-g-i*4)*4
let a = (e&&&(15UL<<<n))
(i,g-1,e-a+(a>>>4), 'l'::l,Nc.[(int (a>>>n))] >= g)
let fZ (n,i,g,e,l) = seq{yield (n,i,g,e,l); if l then yield! fN (n,i,g,e,l)}
match (i,g,l) with
|(0,0,'l'::_) -> yield! fZ fI
|(0,0,'u'::_) -> yield! fZ fE
|(0,0,_) -> yield! fZ fI; yield! fZ fE
|(0,3,'r'::_) -> yield! fZ fI
|(0,3,'u'::_) -> yield! fZ fL
|(0,3,_) -> yield! fZ fI; yield! fZ fL
|(3,0,'l'::_) -> yield! fZ fG
|(3,0,'d'::_) -> yield! fZ fE
|(3,0,_) -> yield! fZ fE; yield! fZ fG
|(3,3,'r'::_) -> yield! fZ fG
|(3,3,'d'::_) -> yield! fZ fL
|(3,3,_) -> yield! fZ fG; yield! fZ fL
|(0,_,'l'::_) -> yield! fZ fI; yield! fZ fL
|(0,_,'r'::_) -> yield! fZ fI; yield! fZ fE
|(0,_,'u'::_) -> yield! fZ fE; yield! fZ fL
|(0,_,_) -> yield! fZ fI; yield! fZ fE; yield! fZ fL
|(_,0,'l'::_) -> yield! fZ fI; yield! fZ fG
|(_,0,'u'::_) -> yield! fZ fE; yield! fZ fG
|(_,0,'d'::_) -> yield! fZ fI; yield! fZ fE
|(_,0,_) -> yield! fZ fI; yield! fZ fE; yield! fZ fG
|(3,_,'l'::_) -> yield! fZ fG; yield! fZ fL
|(3,_,'r'::_) -> yield! fZ fE; yield! fZ fG
|(3,_,'d'::_) -> yield! fZ fE; yield! fZ fL
|(3,_,_) -> yield! fZ fE; yield! fZ fG; yield! fZ fL
|(_,3,'d'::_) -> yield! fZ fI; yield! fZ fL
|(_,3,'u'::_) -> yield! fZ fL; yield! fZ fG
|(_,3,'r'::_) -> yield! fZ fI; yield! fZ fG
|(_,3,_) -> yield! fZ fI; yield! fZ fL; yield! fZ fG
|(_,_,'d'::_) -> yield! fZ fI; yield! fZ fE; yield! fZ fL
|(_,_,'l'::_) -> yield! fZ fI; yield! fZ fG; yield! fZ fL
|(_,_,'r'::_) -> yield! fZ fI; yield! fZ fE; yield! fZ fG
|(_,_,'u'::_) -> yield! fZ fE; yield! fZ fG; yield! fZ fL
|_ -> yield! fZ fI; yield! fZ fE; yield! fZ fG; yield! fZ fL
}
let n = Seq.collect fN n
match (Seq.tryFind(fun(_,_,n,_,_)->n=0x123456789abcdef0UL)) n with
|Some(_,_,_,n,_) -> printf "Solution found with %d moves: " (List.length n); List.iter (string >> printf "%s") (List.rev n); printfn ""
|_ -> Solve (Seq.filter(fun (_,_,_,_,n)->not n) n)
Solve [(2,0,0xfe169b4c0a73d852UL,[],false)]
</lang>
{{out}}
<pre>
Solution found with 52 moves: rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd
</pre>
 
=={{header|Go}}==
{{trans|C++}}
<langsyntaxhighlight lang="go">package main
 
import "fmt"
Line 1,905 ⟶ 6,300:
fifteenSolver(8, 0xfe169b4c0a73d852)
solve()
}</langsyntaxhighlight>
 
{{out}}
Line 1,912 ⟶ 6,307:
</pre>
 
=={{header|PhixJava}}==
<syntaxhighlight lang="java">
<lang Phix>--
-- demo\rosetta\Solve15puzzle.exw
--
constant STM = 0 -- single-tile metrics.
constant MTM = 0 -- multi-tile metrics.
if STM and MTM then ?9/0 end if -- both prohibited
-- 0 0 -- fastest, but non-optimal
-- 1 0 -- optimal in STM
-- 0 1 -- optimal in MTM (slowest by far)
 
import java.util.ArrayList;
--Note: The fast method uses an inadmissible heuristic - see "not STM" in iddfs().
import java.util.HashSet;
-- It explores mtm-style using the higher stm heuristic and may therefore
import java.util.List;
-- fail badly in some cases.
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.stream.Collectors;
 
public final class Puzzle15Solver {
constant SIZE = 4
public static void main(String[] aArgs) {
List<Integer> start = List.of( 15, 14, 1, 6, 9, 11, 4, 12, 0, 10, 7, 3, 13, 8, 5, 2 );
final int zeroIndex = 8;
Puzzle initial = new Puzzle(start, new ArrayList<String>(), zeroIndex, 0);
openSet.add(initial);
System.out.println("Solving the 15 puzzle:");
initial.display();
while ( solution == null ) {
search();
}
 
System.out.println(solution.moves.stream().collect(Collectors.joining("")));
constant goal = { 1, 2, 3, 4,
System.out.println("Number of steps: " + solution.moves.size());
5, 6, 7, 8,
System.out.println("Number of puzzle states checked: " + closedSet.size());
9,10,11,12,
}
13,14,15, 0}
private static void search() {
Puzzle current = openSet.poll();
closedSet.add(current);
final int zeroIndex = current.zeroIndex;
final int row = zeroIndex / 4;
final int column = zeroIndex % 4;
if ( column > 0 ) {
Puzzle nextPuzzle = current.clone();
nextPuzzle.makeMove(Move.LEFT);
}
if ( column < 3 ) {
Puzzle nextPuzzle = current.clone();
nextPuzzle.makeMove(Move.RIGHT);
}
if ( row > 0 ) {
Puzzle nextPuzzle = current.clone();
nextPuzzle.makeMove(Move.UP);
}
if ( row < 3 ) {
Puzzle nextPuzzle = current.clone();
nextPuzzle.makeMove(Move.DOWN);
}
}
 
private enum Move {
--
LEFT("L", -1), RIGHT("R", +1), UP("U", -4), DOWN("D", +4);
-- multi-tile-metric walking distance heuristic lookup (mmwd).
-- ==========================================================
private Move(String aSymbol, int aStep) {
-- Uses patterns of counts of tiles in/from row/col, eg the solved state
symbol = aSymbol;
-- (ie goal above) could be represented by the following:
step = aStep;
-- {{4,0,0,0},
}
-- {0,4,0,0},
-- {0,0,4,0},
private String symbol;
-- {0,0,0,3}}
private Integer step;
-- ie row/col 1 contains 4 tiles from col/row 1, etc. In this case
}
-- both are identical, but you can count row/col or col/row, and then
-- add them together. There are up to 24964 possible patterns. The
private static class Puzzle {
-- blank space is not counted. Note that a vertical move cannot change
-- a vertical pattern, ditto horizontal, and basic symmetry means that
-- row/col and col/row patterns will match (at least, that is, if they
-- are calculated sympathetically), halving the setup cost.
-- The data is just the number of moves made before this pattern was
-- first encountered, in a breadth-first search, backwards from the
-- goal state, until all patterns have been enumerated.
-- (The same ideas/vars are now also used for stm metrics when MTM=0)
--
sequence wdkey -- one such 4x4 pattern
constant mmwd = new_dict() -- lookup table, data is walking distance.
 
public Puzzle(List<Integer> aTiles, List<String> aMoves, int aZeroIndex, int aSearchDepth) {
tiles = aTiles;
moves = aMoves;
zeroIndex = aZeroIndex;
searchDepth = aSearchDepth;
}
public void makeMove(Move aMove) {
Integer temp = tiles.get(zeroIndex + aMove.step);
tiles.set(zeroIndex + aMove.step, 0);
tiles.set(zeroIndex, temp);
zeroIndex += aMove.step;
moves.add(aMove.symbol);
if ( ! closedSet.contains(this) ) {
openSet.add(this);
if ( tiles.equals(Puzzle.GOAL) ) {
solution = this;
}
}
}
 
public long heuristic() {
--
int distance = 0;
-- We use two to-do lists: todo is the current list, and everything
for ( int i = 0; i < tiles.size(); i++ ) {
-- of walkingdistance+1 ends up on tdnx. Once todo is exhausted, we
final int tile = tiles.get(i);
-- swap the dictionary-ids, so tdnx automatically becomes empty.
if ( tile > 0 ) {
-- Key is an mmwd pattern as above, and data is {distance,space_idx}.
distance += Math.abs( ( i / 4 ) - ( tile - 1 ) / 4 ) + Math.abs( ( i % 4 ) - ( tile - 1 ) % 4 );
--
}
integer todo = new_dict()
}
integer tdnx = new_dict()
return distance + searchDepth;
}
public Puzzle clone() {
return new Puzzle(new ArrayList<Integer>(tiles), new ArrayList<String>(moves), zeroIndex, searchDepth + 1);
}
 
public void display() {
--
for ( int i = 0; i < tiles.size(); i++ ) {
System.out.print(String.format("%s%2d%s",
( i % 4 == 0 ) ? "[" : "", tiles.get(i), ( i % 4 == 3 ) ? "]\n" : " "));
}
System.out.println();
}
 
@Override
enum UP = 1, DOWN = -1
public boolean equals(Object aObject) {
return switch(aObject) {
case Puzzle puzzle -> tiles.equals(puzzle.tiles);
case Object object -> false;
};
}
@Override
public int hashCode() {
int hash = 3;
hash = 23 * hash + tiles.hashCode();
hash = 23 * hash + zeroIndex;
return hash;
}
private List<Integer> tiles;
private List<String> moves;
private int zeroIndex;
private int searchDepth;
private static final List<Integer> GOAL = List.of( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 );
}
 
private static Queue<Puzzle> openSet =
procedure explore(integer space_idx, walking_distance, direction)
new PriorityQueue<Puzzle>( (one, two) -> Long.compare(one.heuristic(), two.heuristic()) );
--
private static Set<Puzzle> closedSet = new HashSet<Puzzle>();
-- Given a space index, explore all the possible moves in direction,
private static Puzzle solution;
-- setting the distance and extending the tdnx table.
--
}
integer tile_idx = space_idx+direction
</syntaxhighlight>
for group=1 to SIZE do
{{ out }}
if wdkey[tile_idx][group] then
<pre>
-- ie: check row tile_idx for tiles belonging to rows 1..4
Solving the 15 puzzle:
-- Swap one of those tiles with the space
[15 14 1 6]
wdkey[tile_idx][group] -= 1
[ 9 11 4 12]
wdkey[space_idx][group] += 1
[ 0 10 7 3]
[13 8 5 2]
 
RRRULDLUULDRURDDDLUULURRRDLDDRULDLUURDDLULURRULDRRDD
if getd_index(wdkey,mmwd)=0 then
Number of steps: 52
-- save the walking distance value
Number of puzzle states checked: 2276369
setd(wdkey,walking_distance+1,mmwd)
</pre>
-- and add to the todo next list:
if getd_index(wdkey,tdnx)!=0 then ?9/0 end if
setd(wdkey,{walking_distance+1,tile_idx},tdnx)
end if
 
=={{header|Julia}}==
if MTM then
{{trans|C++}}
if tile_idx>1 and tile_idx<SIZE then
<syntaxhighlight lang="julia">const Nr = [3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3]
-- mtm: same direction means same distance:
const Nc = [3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, explore(tile_idx0, walking_distance1, direction)2]
end if
end if
 
const N0 = zeros(Int, 85)
-- Revert the swap so we can look at the next candidate.
const N2 = zeros(UInt64, 85)
wdkey[tile_idx][group] += 1
const N3 = zeros(UInt8, 85)
wdkey[space_idx][group] -= 1
const N4 = zeros(Int, 85)
end if
const i = 1
end for
const g = 8
end procedure
const ee = 2
const l = 4
const _n = Vector{Int32}([0])
 
function fY(n::Int)
procedure generate_mmwd()
if N2[n + 1] == UInt64(0x123456789abcdef0)
-- Perform a breadth-first search begining with the solved puzzle state
return true, n
-- and exploring from there until no more new patterns emerge.
end
integer walking_distance = 0, space = 4
if N4[n + 1] <= _n[1]
return fN(n)
end
false, n
end
 
function fZ(w, n)
wdkey = {{4,0,0,0}, -- \
if w & i > 0
{0,4,0,0}, -- } 4 tiles in correct row positions
n = {0,0,4,0}, -- /fI(n)
(y, n) = fY(n)
{0,0,0,3}} -- 3 tiles in correct row position
if y return (true, n) end
setd(wdkey,walking_distance,mmwd)
while 1 do n -= 1
end
if space<4 then explore(space, walking_distance, UP) end if
if w & g > 0
if space>1 then explore(space, walking_distance, DOWN) end if
ifn dict_size(todo)=0 thenfG(n)
(y, n) = if dict_sizefY(tdnxn)=0 then exit end if
if y return {todo(true,tdnx} =n) {tdnx,todo}end
endn if-= 1
end
wdkey = getd_partial_key(0,todo)
if w & ee > 0
{walking_distance,space} = getd(wdkey,todo)
deldn = fE(wdkey,todon)
(y, n) = fY(n)
end while
if y return (true, n) end
end procedure
n -= 1
end
if w & l > 0
n = fL(n)
(y, n) = fY(n)
if y return (true, n) end
n -= 1
end
false, n
end
 
function walking_distancefN(sequence puzzlen::Int)
x = N0[n + 1]
sequence rkey = repeat(repeat(0,SIZE),SIZE),
y = UInt8(N3[n + 1])
ckey = repeat(repeat(0,SIZE),SIZE)
integerif kx == 10
for i=1 to SIZE doif y --== rowsUInt8('l')
for j=1 to SIZE doreturn fZ(i, -- columnsn)
elseif y integer tile == puzzle[k]UInt8('u')
ifreturn tile!=0fZ(ee, thenn)
else
integer row = floor((tile-1)/4)+1,
return fZ(i + ee, col = mod(tile-1,4n)+1
rkey[i][row] += 1end
elseif x == 3
ckey[j][col] += 1
if y == end ifUInt8('r')
kreturn +=fZ(i, 1n)
endelseif fory == UInt8('u')
return fZ(l, n)
end for
else
if getd_index(rkey,mmwd)=0
return fZ(i + l, n)
or getd_index(ckey,mmwd)=0 then
?9/0 -- sanity checkend
elseif x == 1 || x == 2
end if
integer rwd if y == getdUInt8(rkey,mmwd'l'),
cwdreturn = getdfZ(ckeyi + l,mmwd n)
elseif y == UInt8('r')
return rwd+cwd
return fZ(i + ee, n)
end function
elseif y == UInt8('u')
return fZ(ee + l, n)
else
return fZ(l + ee + i, n)
end
elseif x == 12
if y == UInt8('l')
return fZ(g, n)
elseif y == UInt8('d')
return fZ(ee, n)
else
return fZ(ee + g, n)
end
elseif x == 15
if y == UInt8('r')
return fZ(g, n)
elseif y == UInt8('d')
return fZ(l, n)
else
return fZ(g + l, n)
end
elseif x == 13 || x == 14
if y == UInt8('l')
return fZ(g + l, n)
elseif y == UInt8('r')
return fZ(ee + g, n)
elseif y == UInt8('d')
return fZ(ee + l, n)
else
return fZ(g + ee + l, n)
end
elseif x == 4 || x == 8
if y == UInt8('l')
return fZ(i + g, n)
elseif y == UInt8('u')
return fZ(g + ee, n)
elseif y == UInt8('d')
return fZ(i + ee, n)
else
return fZ(i + g + ee, n)
end
elseif x == 7 || x == 11
if y == UInt8('d')
return fZ(i + l, n)
elseif y == UInt8('u')
return fZ(g + l, n)
elseif y == UInt8('r')
return fZ(i + g, n)
else
return fZ(i + g + l, n)
end
else
if y == UInt8('d')
return fZ(i + ee + l, n)
elseif y == UInt8('l')
return fZ(i + g + l, n)
elseif y == UInt8('r')
return fZ(i + g + ee, n)
elseif y == UInt8('u')
return fZ(g + ee + l, n)
else
return fZ(i + g + ee + l, n)
end
end
end
 
function fI(n)
sequence puzzle
gg = (11 - N0[n + 1]) * 4
string res = ""
a = N2[n + 1] & (UInt64(0xf) << UInt(gg))
atom t0 = time(),
N0[n t1+ 2] = time()N0[n + 1] + 4
N2[n + 2] = N2[n + 1] - a + (a << 16)
atom tries = 0
N3[n + 2] = UInt8('d')
N4[n + 2] = N4[n + 1]
cond = Nr[(a >> gg) + 1] <= div(N0[n + 1], 4)
if !cond
N4[n + 2] += 1
end
n += 1
n
end
 
function fG(n)
constant ok = {{0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1}, -- left
gg = (19 - N0[n + 1]) * 4
{0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1}, -- up
a = N2[n + 1] & (UInt64(0xf) << UInt(gg))
{1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0}, -- down
N0[n + 2] = N0[n + 1] - 4
{1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0}} -- right
N2[n + 2] = N2[n + 1] - a + (a >> 16)
N3[n + 2] = UInt8('u')
N4[n + 2] = N4[n + 1]
cond = Nr[(a >> gg) + 1] >= div(N0[n + 1], 4)
if !cond
N4[n + 2] += 1
end
n += 1
n
end
 
function iddfsfE(integer step, lim, space, prevmvn)
ifgg = time(14 - N0[n + 1])>t1 then* 4
a = N2[n + 1] & (UInt64(0xf) << UInt(gg))
printf(1,"working... (depth=%d, tries=%d, time=%3ds)\r",{lim,tries,time()-t0})
N0[n + 2] = t1N0[n =+ 1] time()+ 1
N2[n + 2] = N2[n + 1] - a + (a << 4)
end if
triesN3[n + 2] = 1UInt8('r')
N4[n + 2] = N4[n + 1]
integer d = iff(step==lim?0:walking_distance(puzzle))
cond = Nc[(a >> gg) + 1] <= N0[n + 1] % 4
if d=0 then
if !cond
N4[n + 2] += 1
end
n += 1
n
end
 
function fL(n)
return (puzzle==goal)
gg = (16 - N0[n + 1]) * 4
a = N2[n + 1] & (UInt64(0xf) << UInt(gg))
N0[n + 2] = N0[n + 1] - 1
N2[n + 2] = N2[n + 1] - a + (a >> 4)
N3[n + 2] = UInt8('l')
N4[n + 2] = N4[n + 1]
cond = Nc[(a >> gg) + 1] >= N0[n + 1] % 4
if !cond
N4[n + 2] += 1
end
n += 1
n
end
 
function solve(n)
elsif step+d<=lim then
ans, n = fN(n)
if ans
println("Solution found in $n moves: ")
for ch in N3[2:n+1] print(Char(ch)) end; println()
else
println("next iteration, _n[1] will be $(_n[1] + 1)...")
n = 0; _n[1] += 1; solve(n)
end
end
 
run() = (N0[1] = 8; _n[1] = 1; N2[1] = 0xfe169b4c0a73d852; solve(0))
for mv=1 to 4 do -- l/u/d/r
run()
if prevmv!=(5-mv) -- not l after r or vice versa, ditto u/d
</syntaxhighlight>
and ok[mv][space] then
{{output}} <pre>
integer nspace = space+{-1,-4,+4,+1}[mv]
next iteration, _n[1] will be 2...
integer tile = puzzle[nspace]
next iteration, _n[1] will be 3...
if puzzle[space]!=0 then ?9/0 end if -- sanity check
next iteration, _n[1] will be 4...
puzzle[space] = tile
next iteration, _n[1] will be 5...
puzzle[nspace] = 0
next iteration, _n[1] will be 6...
if iddfs(step+iff(MTM or not STM?(prevmv!=mv):1),lim,nspace,mv) then
next iteration, _n[1] will be 7...
res &= "ludr"[mv]
next iteration, _n[1] will be 8...
return true
Solution found in 52 moves:
end if
rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd
puzzle[nspace] = tile
</pre>
puzzle[space] = 0
end if
end for
end if
return false
end function
 
=={{header|Lua}}==
function pack(string s)
===Original===
integer n = length(s), n0 = n
<syntaxhighlight lang="lua">
for i=1 to 4 do
#!/usr/bin/lua
integer ch = "lrud"[i], k
--[[
while 1 do
Solve 3X3 sliding tile puzzle using Astar on Lua. Requires 3mb and
k = match(repeat(ch,3),s)
millions of recursions.
if k=0 then exit end if
by RMM 2020-may-1
s[k+1..k+2] = "3"
]]--
n -= 2
end while
while 1 do
k = match(repeat(ch,2),s)
if k=0 then exit end if
s[k+1] = '2'
n -= 1
end while
end for
return {n,iff(MTM?sprintf("%d",n):sprintf("%d(%d)",{n,n0})),s}
end function
 
local SOLUTION_LIMIT, MAX_F_VALUE = 100,100
procedure apply_moves(string moves, integer space)
local NR, NC, RCSIZE = 4,4,4*4
integer move, ch, nspace
local Up, Down, Right, Left = 'u','d','r','l'
puzzle[space] = 0
local G_cols = {} -- goal columns
for i=1 to length(moves) do
local G_rows = {} -- goal rows
ch = moves[i]
local C_cols = {} -- current cols
if ch>'3' then
local C_rows = {} -- current rows
move = find(ch,"ulrd")
local Goal = {}
end if
local Tiles = {} -- the puzzle
-- (hint: "r" -> the 'r' does 1
local Solution = {} -- final path is instance of desc
-- "r2" -> the 'r' does 1, the '2' does 1
local desc = {} -- descending path
-- "r3" -> the 'r' does 1, the '3' does 2!)
desc[0] = 0 -- override Lua default "1" index
for j=1 to 1+(ch='3') do
nspace = space+{-4,-1,+1,4}[move]
puzzle[space] = puzzle[nspace]
space = nspace
puzzle[nspace] = 0
end for
end for
end procedure
 
-- @brief create C compatible array for Lua
function solvable(sequence board)
local function Amake( list )
integer n = length(board)
array = {}
sequence positions = repeat(0,n)
for i=0, #list do
-- prepare the mapping from each tile to its position
array[i] = list[i+1] -- simulate "C" array in Lua
board[find(0,board)] = n
end
for i=1 to n do
return array
positions[board[i]] = i
end for
 
G_cols= Amake({0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, } )
G_rows= Amake({0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, } )
C_cols= Amake({0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, } )
C_rows= Amake({0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, } )
Tiles = Amake({ 15,14,1,6, 9,11,4,12, 0,10,7,3, 13,8,5,2,} )
Goal = Amake({1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,0,} )
 
local m1 = {recursions=0, found=0, threshold=0, times=0, steps=0,}
-- ---------------------------------------------------------------
-- return 1D array index given 2D row,column
local function rcidx( row, col )
return (row * NR + col)
end
 
-- @brief recursive search
-- @return f_score
local function search( depth, x_row, x_col, h_score)
local move, go_back_move, last_move_by_current
local f_score, ix, min, temp, hscore2, idx1
local N_minus_one = NR - 1;
local rc1 = {row=0,col=0}
local rc2 = {row=0,col=0}
local gtmp = {row=0,col=0}
 
f_score = depth + h_score;
if f_score > m1.threshold then return f_score end
if h_score == 0 then do
m1.found = 1
Solution = table.concat(desc)
return f_score end end
m1.recursions = m1.recursions+1
m1.times = m1.times + 1
if m1.times > 200000 then do
print("Recursions ",m1.recursions)
m1.times = 0
end end
min = 999999
last_move_by_current = desc[depth];
rc1.row = x_row;
rc1.col = x_col;
for ix = 0,3 do
if ix==0 then do
move = Up;
go_back_move = Down;
rc2.row = x_row - 1;
rc2.col = x_col;
end
elseif ix==1 then do
move = Down;
go_back_move = Up;
rc2.row = x_row + 1;
rc2.col = x_col;
end
elseif ix==2 then do
move = Left;
go_back_move = Right;
rc2.row = x_row;
rc2.col = x_col - 1;
end
elseif ix==3 then do
move = Right;
go_back_move = Left;
rc2.row = x_row;
rc2.col = x_col + 1;
end end
if move==Up and x_row==0 then goto next end
if move==Down and x_row==N_minus_one then goto next end
if move==Left and x_col==0 then goto next end
if move==Right and x_col==N_minus_one then goto next end
if last_move_by_current==go_back_move then goto next end
hscore2 = h_score
idx1 = Tiles[rcidx(rc2.row,rc2.col)]
gtmp.row = G_rows[idx1]
gtmp.col = G_cols[idx1]
local h_adj=0
if go_back_move==Up then do
if gtmp.row < C_rows[idx1] then
h_adj = -1 else h_adj = 1 end end
end
if go_back_move==Down then do
if gtmp.row > C_rows[idx1] then
h_adj = -1 else h_adj = 1 end end
end
if go_back_move==Left then do
if gtmp.col < C_cols[idx1] then
h_adj = -1 else h_adj = 1 end end
end
if go_back_move==Right then do
if gtmp.col > C_cols[idx1] then
h_adj = -1 else h_adj = 1 end end
end
hscore2 = hscore2 + h_adj
C_rows[0] = rc2.row;
C_cols[0] = rc2.col;
C_rows[idx1] = rc1.row;
C_cols[idx1] = rc1.col;
Tiles[rcidx(rc1.row,rc1.col)] = idx1;
Tiles[rcidx(rc2.row,rc2.col)] = 0;
desc[depth+1] = move
desc[depth+2] = '\0'
 
temp = search(depth+1, rc2.row, rc2.col, hscore2); -- descend
-- regress
Tiles[rcidx(rc1.row,rc1.col)] = 0
Tiles[rcidx(rc2.row,rc2.col)] = idx1
desc[depth+1] = '\0'
C_rows[0] = rc1.row;
C_cols[0] = rc1.col;
C_rows[idx1] = rc2.row;
C_cols[idx1] = rc2.col;
if m1.found == 1 then return temp end
if temp < min then min = temp end
::next:: -- Lua does not have "continue;" so uses goto
end -- end for
m1.found = 0;
-- return the minimum f_score greater than m1.threshold
return min;
end
 
-- @brief Run solver using A-star algorithm
-- @param Tiles .. 3X3 sliding tile puzzle
local function solve(Tiles)
local temp, i,j
local x_row, x_col, h_score = 0,0,0
 
m1.found = 0;
for i=0,(NR-1) do
for j=0, (NC-1) do
G_rows[ Goal[rcidx(i,j)] ] = i;
G_cols[ Goal[rcidx(i,j)] ] = j;
C_rows[ Tiles[rcidx(i,j)] ] = i;
C_cols[ Tiles[rcidx(i,j)] ] = j;
end
end
for i=0,(NR-1) do
for j=0, (NC-1) do
if Tiles[rcidx(i,j)] == 0 then do
x_row = i;
x_col = j;
break;
end
end
end
end
 
desc[0] = '$'
desc[1] = '\0'
 
h_score = 0; -- Manhattan/Taxicab heuristic
for i = 1,(RCSIZE-1) do
h_score = h_score + (math.abs(C_rows[i] - G_rows[i]) +
math.abs(C_cols[i] - G_cols[i]))
end
m1.threshold = h_score
print("solve -> search")
while true do
temp = search( 0, x_row, x_col, h_score);
if m1.found == 1 then do
print("Gound solution of length",#Solution-1)
print(Solution)
break;
end end
if temp > MAX_F_VALUE then do
-- check whether this is an even or odd state
print("Maximum f value reached! terminating! \n");
integer row = floor((positions[16]-1)/4),
break; end
col = (positions[16]-1)-row*4
end
bool even_state = (positions[16]==16) or (mod(row,2)==mod(col,2))
m1.threshold = temp;
end -- count the even cycleswhile
return 0
integer even_count = 0
end
sequence visited = repeat(false,16)
for i=1 to n do
if not visited[i] then
-- a new cycle starts at i. Count its length..
integer cycle_length = 0,
next_tile = i
while not visited[next_tile] do
cycle_length +=1
visited[next_tile] = true
next_tile = positions[next_tile]
end while
even_count += (mod(cycle_length,2)==0)
end if
end for
return even_state == (mod(even_count,2)==0)
end function
 
-- show sliding tile puzzle rows and columns
procedure main()
local function print_tiles( pt)
local i,j,num
for i=0,(NR-1) do
for j=0, (NC-1) do
num = pt[rcidx(i,j)]
io.write(string.format("%02d ", num))
end
print("")
end
print("")
end
 
-- main(void) {
puzzle = {15,14, 1, 6,
print("Solve sliding 15 tile puzzle");
9,11, 4,12,
m1.recursions = 0
0,10, 7, 3,
m1.times=0
13, 8, 5, 2}
print_tiles(Tiles);
print_tiles(Goal)
solve(Tiles);
</syntaxhighlight>
{{output}} <pre>
FOUND SOLUTION of length 52 rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd
</pre>
 
===Alternate (with extra credit)===
if not solvable(puzzle) then
<syntaxhighlight lang="lua">
?puzzle
----------
printf(1,"puzzle is not solveable\n")
-- SOLVER
else
----------
 
local table_concat = table.concat -- local alias
generate_mmwd()
 
local function Solver(root, h, successors)
sequence original = puzzle
local pathlist, pathhash, iters
integer space = find(0,puzzle)
-- it is required that "h(node)" returns:
-- 0 when "is_goal(node)==true"
-- >0 when "is_goal(node)==false"
-- (because it allows for some simplification herein)
local FOUND = 0 -- ie: "is_goal(node)==true"
local NOT_FOUND = 1e9 -- some number larger than largest possible f
 
local function hash(node)
for lim=walking_distance(puzzle) to iff(MTM?43:80) do
return table_concat(node,",")
if iddfs(0, lim, space, '-') then exit end if
end for
 
local function search(g, bound)
{integer n, string ns, string ans} = pack(reverse(res))
iters = iters + 1
--if ((iters % 1000000) == 0) then print("iterations:", iters) end
local node = pathlist[#pathlist]
local h = h(node)
local f = g + h
if (f > bound) then return f end
if (h == FOUND) then return FOUND end
local min = NOT_FOUND
for succ, cost in successors(node) do
local succhash = hash(succ)
if (not pathhash[succhash]) then
pathlist[#pathlist+1], pathhash[succhash] = succ, true
local t = search(g+cost, bound)
if (t == FOUND) then return FOUND end
if (t < min) then min = t end
pathlist[#pathlist], pathhash[succhash] = nil, nil
end
end
return min
end
 
return {
printf(1,"\n\noriginal:")
solve = ?originalfunction()
pathlist = atom{ t =root time()-t0}
pathhash = { [hash(root)] = true }
printf(1,"\n%soptimal solution of %s moves found in %s: %s\n\nresult: ",
iters = 0
{iff(MTM?"mtm-":iff(STM?"stm-":"non-")),ns,elapsed(t),ans})
local puzzlebound = originalh(root)
while true apply_moves(ans,space)do
?puzzlebound = search(0, bound)
if (bound == FOUND) then return bound, iters, pathlist end
end if
if (bound == NOT_FOUND) then return bound, iters, nil end
end procedure
end
main()</lang>
end
}
end
 
------------------
-- DOMAIN SUPPORT
------------------
 
local i2c = { [0]=0, 1,2,3,4, 1,2,3,4, 1,2,3,4, 1,2,3,4 } -- convert index to column
local i2r = { [0]=0, 1,1,1,1, 2,2,2,2, 3,3,3,3, 4,4,4,4 } -- convert index to row
local R, U, L, D = 1, -4, -1, 4 -- move indexing values
local movenames = { -- move names
[0]="", [R]="r", [U]="u", [L]="l", [D]="d"
}
local succmoves = { -- successor directions
{R,D}, {R,L,D}, {R,L,D}, {L,D},
{R,U,D}, {R,U,L,D}, {R,U,L,D}, {U,L,D},
{R,U,D}, {R,U,L,D}, {R,U,L,D}, {U,L,D},
{R,U}, {R,U,L}, {R,U,L}, {U,L}
}
local manhdists = { -- manhattan distances
{ [0]=0, 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6 },
{ [0]=0, 1, 0, 1, 2, 2, 1, 2, 3, 3, 2, 3, 4, 4, 3, 4, 5 },
{ [0]=0, 2, 1, 0, 1, 3, 2, 1, 2, 4, 3, 2, 3, 5, 4, 3, 4 },
{ [0]=0, 3, 2, 1, 0, 4, 3, 2, 1, 5, 4, 3, 2, 6, 5, 4, 3 },
{ [0]=0, 1, 2, 3, 4, 0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5 },
{ [0]=0, 2, 1, 2, 3, 1, 0, 1, 2, 2, 1, 2, 3, 3, 2, 3, 4 },
{ [0]=0, 3, 2, 1, 2, 2, 1, 0, 1, 3, 2, 1, 2, 4, 3, 2, 3 },
{ [0]=0, 4, 3, 2, 1, 3, 2, 1, 0, 4, 3, 2, 1, 5, 4, 3, 2 },
{ [0]=0, 2, 3, 4, 5, 1, 2, 3, 4, 0, 1, 2, 3, 1, 2, 3, 4 },
{ [0]=0, 3, 2, 3, 4, 2, 1, 2, 3, 1, 0, 1, 2, 2, 1, 2, 3 },
{ [0]=0, 4, 3, 2, 3, 3, 2, 1, 2, 2, 1, 0, 1, 3, 2, 1, 2 },
{ [0]=0, 5, 4, 3, 2, 4, 3, 2, 1, 3, 2, 1, 0, 4, 3, 2, 1 },
{ [0]=0, 3, 4, 5, 6, 2, 3, 4, 5, 1, 2, 3, 4, 0, 1, 2, 3 },
{ [0]=0, 4, 3, 4, 5, 3, 2, 3, 4, 2, 1, 2, 3, 1, 0, 1, 2 },
{ [0]=0, 5, 4, 3, 4, 4, 3, 2, 3, 3, 2, 1, 2, 2, 1, 0, 1 },
{ [0]=0, 6, 5, 4, 3, 5, 4, 3, 2, 4, 3, 2, 1, 3, 2, 1, 0 },
}
 
--- create a state from a pattern, optionally applying a move
local function state(patt, move)
local node = {}
for k,v in pairs(patt) do node[k] = v end
if (move) then
local e = node.e
local ep = e + move
node[e], node[ep] = node[ep], 0
node.e, node.m = ep, move
end
return node
end
 
--- iterator for successors of node
local function successors(node)
local moves = succmoves[node.e]
local i, n = 0, #moves
return function()
i = i + 1
if (i <= n) then
return state(node, moves[i]), 1
end
end
end
 
--- hueristic estimate of travel cost from node to goal
local function h(node)
local sum, ijx, jix, t = 0, 1, 1
for i = 1, 4 do
local colmax, rowmax = 0, 0
for j = 1, 4 do
t = node[ijx]
sum = sum + manhdists[ijx][t] -- manhattan
if (i2r[t] == i) then -- row conflicts
if (t > rowmax) then rowmax=t else sum=sum+2 end
end
t = node[jix]
if (i2c[t] == i) then -- col conflicts
if (t > colmax) then colmax=t else sum=sum+2 end
end
ijx, jix = ijx+1, jix+4
end
jix = jix - 15
end
return sum
end
 
------------------
-- PRINT SUPPORT:
------------------
 
local function printnode(node)
print("+--+--+--+--+")
for i = 0, 12, 4 do
print( string.format("|%2d|%2d|%2d|%2d|", node[i+1], node[i+2], node[i+3], node[i+4]) )
print("+--+--+--+--+")
end
end
 
local function printpath(path)
-- note that #path is 1 longer than solution due to root node at path[1]
-- concatenated result will be correct length since movenames[root.m]==""
local t = {}
for i, node in ipairs(path) do
t[i] = movenames[node.m]
end
local pathstr = table_concat(t)
print("SOLUTION: " .. pathstr .. " (length: " .. #pathstr .. ")")
end
 
---------
-- TASKS:
---------
 
-- goal is implied by h(), never actually used (see solver's notes)
-- local goal = state({ 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,0, e=16, m=0 })
 
do
print("PRIMARY TASK (OPTIMALLY)")
local sclock = os.clock()
local root = state({ 15,14,1,6, 9,11,4,12, 0,10,7,3, 13,8,5,2, e=9, m=0 })
printnode(root)
local solver = Solver(root, h, successors)
local bound, iters, path = solver:solve()
printpath(path)
printnode(path[#path])
print("ITERATIONS: " .. iters)
print("ELAPSED: " .. (os.clock()-sclock) .. "s")
end
 
print()
 
do
print("EXTRA CREDIT TASK (APPROXIMATELY, NON-OPTIMALLY)")
-- only primary task specifies "fewest possible moves"
-- extra credit task only specifies "solve", so..
local sclock = os.clock()
local root = state({ 0,12,9,13, 15,11,10,14, 3,7,2,5, 4,8,6,1, e=1, m=0 })
printnode(root)
local function hec(node)
-- overweighting h makes it not admissible,
-- causing solver to favor g when minimizing,
-- leading to non-optimal (but much easier to find!) solutions
return h(node)*1.5
end
local solver = Solver(root, hec, successors)
local bound, iters, path = solver:solve()
printpath(path) --> 86, optimal solution is known to be 80
printnode(path[#path])
print("ITERATIONS: " .. iters)
print("ELAPSED: " .. (os.clock()-sclock) .. "s")
end
</syntaxhighlight>
{{out}}
<pre>
PRIMARY TASK (OPTIMALLY)
+--+--+--+--+
|15|14| 1| 6|
+--+--+--+--+
| 9|11| 4|12|
+--+--+--+--+
| 0|10| 7| 3|
+--+--+--+--+
|13| 8| 5| 2|
+--+--+--+--+
SOLUTION: rrruldluuldrurdddluulurrrdlddruldluurddlulurruldrrdd (length: 52)
+--+--+--+--+
| 1| 2| 3| 4|
+--+--+--+--+
| 5| 6| 7| 8|
+--+--+--+--+
| 9|10|11|12|
+--+--+--+--+
|13|14|15| 0|
+--+--+--+--+
ITERATIONS: 4963696
ELAPSED: 34.279s
 
EXTRA CREDIT TASK (APPROXIMATELY, NON-OPTIMALLY)
+--+--+--+--+
| 0|12| 9|13|
+--+--+--+--+
|15|11|10|14|
+--+--+--+--+
| 3| 7| 2| 5|
+--+--+--+--+
| 4| 8| 6| 1|
+--+--+--+--+
SOLUTION: rrdldruldluruldrdrrululdrddlluurrddlluurrdrdllurrdlluruurddluurddluulddrdluluruldddrrr (length: 86)
+--+--+--+--+
| 1| 2| 3| 4|
+--+--+--+--+
| 5| 6| 7| 8|
+--+--+--+--+
| 9|10|11|12|
+--+--+--+--+
|13|14|15| 0|
+--+--+--+--+
ITERATIONS: 1325248
ELAPSED: 9.101s
</pre>
 
=={{header|Nim}}==
{{trans|C++}}
====The solver====
<syntaxhighlight lang="nim">
# 15 puzzle.
 
import strformat
import times
 
const
Nr = [3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3]
Nc = [3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2]
 
type
 
Solver = object
n: int
np: int
n0: array[100, int]
n2: array[100, uint64]
n3: array[100, char]
n4: array[100, int]
 
Value = range[0..15]
 
# Forward definition.
proc fN(s: var Solver): bool
 
#---------------------------------------------------------------------------------------------------
 
proc fI(s: var Solver) =
 
let n = s.n
let g = (11 - s.n0[n]) * 4
let a = s.n2[n] and uint(15 shl g)
s.n0[n + 1] = s.n0[n] + 4
s.n2[n + 1] = s.n2[n] - a + a shl 16
s.n3[n + 1] = 'd'
s.n4[n + 1] = s.n4[n] + ord(Nr[a shr g] > s.n0[n] div 4)
 
#---------------------------------------------------------------------------------------------------
 
proc fG(s: var Solver) =
 
let n = s.n
let g = (19 - s.n0[n]) * 4
let a = s.n2[n] and uint(15 shl g)
s.n0[n + 1] = s.n0[n] - 4
s.n2[n + 1] = s.n2[n] - a + a shr 16
s.n3[n + 1] = 'u'
s.n4[n + 1] = s.n4[n] + ord(Nr[a shr g] < s.n0[n] div 4)
 
#---------------------------------------------------------------------------------------------------
 
proc fE(s: var Solver) =
 
let n = s.n
let g = (14 - s.n0[n]) * 4
let a = s.n2[n] and uint(15 shl g)
s.n0[n + 1] = s.n0[n] + 1
s.n2[n + 1] = s.n2[n] - a + a shl 4
s.n3[n + 1] = 'r'
s.n4[n + 1] = s.n4[n] + ord(Nc[a shr g] > s.n0[n] mod 4)
 
#---------------------------------------------------------------------------------------------------
 
proc fL(s: var Solver) =
 
let n = s.n
let g = (16 - s.n0[n]) * 4
let a = s.n2[n] and uint(15 shl g)
s.n0[n + 1] = s.n0[n] - 1
s.n2[n + 1] = s.n2[n] - a + a shr 4
s.n3[n + 1] = 'l'
s.n4[n + 1] = s.n4[n] + ord(Nc[a shr g] < s.n0[n] mod 4)
 
#---------------------------------------------------------------------------------------------------
 
proc fY(s: var Solver): bool =
 
if s.n2[s.n] == 0x123456789abcdef0'u:
return true
if s.n4[s.n] <= s.np:
return s.fN()
 
#---------------------------------------------------------------------------------------------------
 
proc fN(s: var Solver): bool =
 
let n = s.n
if s.n3[n] != 'u' and s.n0[n] div 4 < 3:
s.fI
inc s.n
if s.fY(): return true
dec s.n
if s.n3[n] != 'd' and s.n0[n] div 4 > 0:
s.fG()
inc s.n
if s.fY(): return true
dec s.n
if s.n3[n] != 'l' and s.n0[n] mod 4 < 3:
s.fE()
inc s.n
if s.fY(): return true
dec s.n
if s.n3[n] != 'r' and s.n0[n] mod 4 > 0:
s.fL()
inc s.n
if s.fY(): return true
dec s.n
 
#---------------------------------------------------------------------------------------------------
 
proc initSolver(values: array[16, Value]): Solver {.noInit.} =
 
result.n = 0
result.np = 0
result.n0[0] = values.find(0)
result.n2[0] = (var tmp = 0'u; for val in values: tmp = tmp shl 4 or uint(val); tmp)
result.n4[0] = 0
 
#---------------------------------------------------------------------------------------------------
 
proc run(s: var Solver) =
 
while not s.fY():
inc s.np
stdout.write(fmt"Solution found with {s.n} moves: ")
for g in 1..s.n:
stdout.write(s.n3[g])
stdout.write(".\n")
 
#---------------------------------------------------------------------------------------------------
 
proc toString(d: Duration): string =
# Custom representation of a duration.
const Plural: array[bool, string] = ["", "s"]
var ms = d.inMilliseconds
for (label, d) in {"hour": 3_600_000, "minute": 60_000, "second": 1_000, "millisecond": 1}:
let val = ms div d
if val > 0:
result.add($val & ' ' & label & Plural[val > 1])
ms = ms mod d
if ms > 0: result.add(' ')
</syntaxhighlight>
 
====The task====
<syntaxhighlight lang="nim">
let start = getTime()
var solver = initSolver([Value 15, 14, 1, 6,
9, 11, 4, 12,
0, 10, 7, 3,
13, 8, 5, 2])
solver.run()
echo fmt"Execution time: {(getTime() - start).toString}."
</syntaxhighlight>
{{out}}
<pre>
Solution found with 52 moves: rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd.
Execution time: 504 milliseconds.
</pre>
====Extra credit====
<syntaxhighlight lang="nim">
let start = getTime()
var solver = initSolver([Value 0, 12, 9, 13,
15, 11, 10, 14,
3, 7, 2, 5,
4, 8, 6, 1])
solver.run()
echo fmt"Execution time: {(getTime() - start).toString}."
</syntaxhighlight>
{{out}}
<pre>
Solution found with 80 moves: dddrurdruuulllddrulddrrruuullddruulldddrrurulldrruulldlddrurullddrrruullulddrdrr.
Execution time: 3 hours 44 minutes 47 seconds 2 milliseconds.
</pre>
 
=={{header|Pascal}}==
===The Solver===
<syntaxhighlight lang="pascal">
unit FifteenSolverT;
\\ Solve 15 Puzzle. Nigel Galloway; February 1st., 2019.
interface
type TN=record n:UInt64; i,g,e,l:shortint; end;
type TG=record found:boolean; path:array[0..99] of TN; end;
function solve15(const board : UInt64; const bPos:shortint; const d:shortint; const ng:shortint):TG;
const endPos:UInt64=$123456789abcdef0;
implementation
const N:array[0..15] of shortint=(3,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3);
const I:array[0..15] of shortint=(3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2);
const G:array[0..15] of shortint=(5,13,13,9,7,15,15,11,7,15,15,11,6,14,14,10);
const E:array[0..15] of shortint=(0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4);
const L:array[0..4 ] of shortint=(0,11,19,14,16);
function solve15(const board:UInt64; const bPos:shortint; const d:shortint; const ng:shortint):TG;
var path:TG; P:^TN; Q:^TN; _g:shortint; _n:UInt64;
begin P:=@path.path; P^.n:=board; P^.i:=0; P^.g:=0; P^.e:=ng; P^.l:=bPos;
while true do begin
if P<@path.path then begin path.found:=false; exit(path); end;
if P^.n=endPos then begin path.found:=true; exit(path); end;
if (P^.e=0) or (P^.i>d) then begin P-=1; continue; end else begin Q:=P+1; Q^.g:=E[P^.e]; end;
Q^.i:=P^.i; _g:=(L[Q^.g]-P^.l)*4; _n:=P^.n and (UInt64($F)<<_g);
case Q^.g of
1:begin Q^.l:=P^.l+4; Q^.e:=G[Q^.l]-2; P^.e-=1; Q^.n:=P^.n-_n+(_n<<16); if N[_n>>_g]>=(Q^.l div 4) then Q^.i+=1; end;
2:begin Q^.l:=P^.l-4; Q^.e:=G[Q^.l]-1; P^.e-=2; Q^.n:=P^.n-_n+(_n>>16); if N[_n>>_g]<=(Q^.l div 4) then Q^.i+=1; end;
3:begin Q^.l:=P^.l+1; Q^.e:=G[Q^.l]-8; P^.e-=4; Q^.n:=P^.n-_n+(_n<< 4); if I[_n>>_g]>=(Q^.l mod 4) then Q^.i+=1; end;
4:begin Q^.l:=P^.l-1; Q^.e:=G[Q^.l]-4; P^.e-=8; Q^.n:=P^.n-_n+(_n>> 4); if I[_n>>_g]<=(Q^.l mod 4) then Q^.i+=1; end;
end;
P+=1;
end;
end;
end.
</syntaxhighlight>
<syntaxhighlight lang="pascal">
// Threaded use of 15 solver Unit. Nigel Galloway; February 1st., 2019.
program testFifteenSolver;
uses {$IFDEF UNIX}cthreads,{$ENDIF}sysutils,strutils,FifteenSolverT;
var Tz:array[0..5] of TThreadID; Tr:array[0..5] of TG; Tc:array[0..5] of shortint; Tw:array[0..5] of shortint;
const N:array[0..4 ] of string=('','d','u','r','l');
const G:array[0..15] of string=('41','841','841','81','421','8421','8421','821','421','8421','8421','821','42','842','842','82');
var ip:string; x,y:UInt64; P,Q:^TN; bPos,v,w,z,f:shortint; time1, time2: TDateTime; c:char;
function T(a:pointer):ptrint;
begin
Tr[uint32(a)]:=solve15(x,bPos,Tw[uint32(a)],Tc[uint32(a)]);
if Tr[uint32(a)].found then f:=uint32(a);
T:=0;
end;
begin
ReadLn(ip);
bPos:=Npos('0',ip,1)-1; w:=0; z:=0; f:=-1;
y:=(UInt64(Hex2Dec(ip[9..17]))<<32)>>32; x:=UInt64(Hex2Dec(ip[1..8]))<<32+y;
time1:=Now;
for w:=0 to $7f do begin
for c in G[bpos] do begin v:=z mod 6; Tc[v]:=integer(c)-48; Tw[v]:=w;
Tz[v]:=BeginThread(@T,pointer(v));
z+=1; if z>5 then waitforthreadterminate(Tz[z mod 6],$7fff);
end;
if f>=0 then break;
end;
for bpos:=0 to 5 do if Tw[bpos]>=Tw[f] then killthread(Tz[bpos]) else waitforthreadterminate(Tz[bpos],$7fff);
time2:=Now; WriteLn('Solution(s) found in ' + FormatDateTime('hh.mm.ss.zzz', time2-time1) + ' seconds');
for bpos:=0 to 5 do if Tr[bpos].found then begin
P:=@Tr[bpos].path; repeat Q:=P; Write(N[Q^.g]); P+=1; until Q^.n=endpos; WriteLn();
end;
end.
</syntaxhighlight>
===The Task===
{{out}}
<pre>
fe169b4c0a73d852
Solution(s) found in 00.00.00.423 seconds
rrruldluuldrurdddluulurrrdlddruldluurddlulurruldrrdd
</pre>
===Extra Credit===
{{out}}
<pre>
0c9dfbae37254861
Solution(s) found in 12.58.46.194 seconds
rrrdldlluurrddluurrdlurdddllluurrdrdlluluurrdddluurddlluururdrddlluurrullldrrrdd
drrrdlluurrdddlluururddlurddlulldrrulluurrdrdllluurrdrdllldruururdddlluluurrrddd
</pre>
 
=={{header|Picat}}==
<syntaxhighlight lang="picat">import planner.
 
main =>
init(InitS),
goal(GoalS),
best_plan((InitS,GoalS),Plan),
println(Plan).
 
init(InitS) =>
M = {{15, 14, 1, 6},
{9 , 11, 4, 12},
{0, 10, 7, 3},
{13, 8, 5, 2}},
InitS = [(R,C) : T in 0..15, pos(M,T,R,C)].
 
goal(GoalS) =>
M = {{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13,14, 15, 0}},
GoalS = [(R,C) : T in 0..15, pos(M,T,R,C)].
 
pos(M,T,R,C) =>
N = len(M),
between(1,N,R),
between(1,N,C),
M[R,C] == T,!.
final((S,GoalS)) => S == GoalS.
 
action((S,GoalS),NextS,Action,Cost) =>
S = [P0|Tiles],
P0 = (R0,C0),
Cost = 1,
(R1 = R0-1, R1 >= 1, C1 = C0, Action = u;
R1 = R0+1, R1 =< 4, C1 = C0, Action = d;
R1 = R0, C1 = C0-1, C1 >= 1, Action = l;
R1 = R0, C1 = C0+1, C1 =< 4, Action = r),
P1 = (R1,C1),
slide(P0,P1,Tiles,Tiles1),
S1 = [P1|Tiles1],
NextS = (S1,GoalS).
 
% slide the tile at P1 to the empty square at P0
slide(P0,P1,[P1|Tiles],Tiles1) =>
Tiles1 = [P0|Tiles].
slide(P0,P1,[Tile|Tiles],Tiles1) =>
Tiles1=[Tile|Tiles1R],
slide(P0,P1,Tiles,Tiles1R).
 
% called by the planner
heuristic((S,GoalS)) = Dist =>
S = [_|Tiles],
GoalS = [_|FTiles],
Dist = sum([abs(R-FR)+abs(C-FC) :
{(R,C),(FR,FC)} in zip(Tiles,FTiles)]).
 
</syntaxhighlight>
 
{{out}}
<pre>
rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd
</pre>
 
=={{header|Perl}}==
{{trans|Raku}}
<syntaxhighlight lang="perl">use strict;
no warnings;
 
use enum qw(False True);
use constant Nr => <3 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3>;
use constant Nc => <3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2>;
 
my ($n, $m) = (0, 0);
my(@N0, @N2, @N3, @N4);
 
sub fY {
printf "Solution found in $n moves: %s\n", join('', @N3) and exit if $N2[$n] == 0x123456789abcdef0;
$N4[$n] <= $m ? fN() : False;
}
 
sub fN {
sub common { ++$n; return True if fY(); --$n }
if ($N3[$n] ne 'u' and int($N0[$n] / 4) < 3) { fI(); common() }
if ($N3[$n] ne 'd' and int($N0[$n] / 4) > 0) { fG(); common() }
if ($N3[$n] ne 'l' and ($N0[$n] % 4) < 3) { fE(); common() }
if ($N3[$n] ne 'r' and ($N0[$n] % 4) > 0) { fL(); common() }
return False;
}
 
sub fI {
my $g = (11-$N0[$n])*4;
my $a = $N2[$n] & (15 << $g);
$N0[$n+1] = $N0[$n]+4;
$N2[$n+1] = $N2[$n]-$a+($a<<16);
$N4[$n+1] = $N4[$n]+((Nr)[$a>>$g] <= int($N0[$n] / 4) ? 0 : 1);
$N3[$n+1] = 'd';
}
 
sub fG {
my $g = (19-$N0[$n])*4;
my $a = $N2[$n] & (15 << $g);
$N0[$n+1] = $N0[$n]-4;
$N2[$n+1] = $N2[$n]-$a+($a>>16);
$N4[$n+1] = $N4[$n]+((Nr)[$a>>$g] >= int($N0[$n] / 4) ? 0 : 1);
$N3[$n+1] = 'u';
}
 
sub fE {
my $g = (14-$N0[$n])*4;
my $a = $N2[$n] & (15 << $g);
$N0[$n+1] = $N0[$n]+1;
$N2[$n+1] = $N2[$n]-$a+($a<<4);
$N4[$n+1] = $N4[$n]+((Nc)[$a>>$g] <= $N0[$n]%4 ? 0 : 1);
$N3[$n+1] = 'r';
}
 
sub fL {
my $g = (16-$N0[$n])*4;
my $a = $N2[$n] & (15 << $g);
$N0[$n+1] = $N0[$n]-1;
$N2[$n+1] = $N2[$n]-$a+($a>>4);
$N4[$n+1] = $N4[$n]+((Nc)[$a>>$g] >= $N0[$n]%4 ? 0 : 1);
$N3[$n+1] = 'l';
}
 
($N0[0], $N2[0]) = (8, 0xfe169b4c0a73d852); # initial state
while () { fY() or ++$m }</syntaxhighlight>
{{out}}
<pre>Solution found in 52 moves: rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd</pre>
 
=={{header|Phix}}==
<!--<syntaxhighlight lang="phix">-->
<span style="color: #000080;font-style:italic;">-- demo\rosetta\Solve15puzzle.exw</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">STM</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span> <span style="color: #000080;font-style:italic;">-- single-tile metrics.</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">MTM</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span> <span style="color: #000080;font-style:italic;">-- multi-tile metrics.</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">STM</span> <span style="color: #008080;">and</span> <span style="color: #000000;">MTM</span> <span style="color: #008080;">then</span> <span style="color: #0000FF;">?<span style="color: #000000;">9<span style="color: #0000FF;">/<span style="color: #000000;">0</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span> <span style="color: #000080;font-style:italic;">-- both prohibited
-- 0 0 -- fastest, but non-optimal
-- 1 0 -- optimal in STM
-- 0 1 -- optimal in MTM (slowest by far)
--Note: The fast method uses an inadmissible heuristic - see "not STM" in iddfs().
-- It explores mtm-style using the higher stm heuristic and may therefore
-- fail badly in some cases.</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">SIZE</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">4</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">goal</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{</span> <span style="color: #000000;">1<span style="color: #0000FF;">,</span> <span style="color: #000000;">2<span style="color: #0000FF;">,</span> <span style="color: #000000;">3<span style="color: #0000FF;">,</span> <span style="color: #000000;">4<span style="color: #0000FF;">,</span>
<span style="color: #000000;">5<span style="color: #0000FF;">,</span> <span style="color: #000000;">6<span style="color: #0000FF;">,</span> <span style="color: #000000;">7<span style="color: #0000FF;">,</span> <span style="color: #000000;">8<span style="color: #0000FF;">,</span>
<span style="color: #000000;">9<span style="color: #0000FF;">,<span style="color: #000000;">10<span style="color: #0000FF;">,<span style="color: #000000;">11<span style="color: #0000FF;">,<span style="color: #000000;">12<span style="color: #0000FF;">,</span>
<span style="color: #000000;">13<span style="color: #0000FF;">,<span style="color: #000000;">14<span style="color: #0000FF;">,<span style="color: #000000;">15<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">}</span>
<span style="color: #000080;font-style:italic;">--
-- multi-tile-metric walking distance heuristic lookup (mmwd).
-- ==========================================================
-- Uses patterns of counts of tiles in/from row/col, eg the solved state
-- (ie goal above) could be represented by the following:
-- {{4,0,0,0},
-- {0,4,0,0},
-- {0,0,4,0},
-- {0,0,0,3}}
-- ie row/col 1 contains 4 tiles from col/row 1, etc. In this case
-- both are identical, but you can count row/col or col/row, and then
-- add them together. There are up to 24964 possible patterns. The
-- blank space is not counted. Note that a vertical move cannot change
-- a vertical pattern, ditto horizontal, and basic symmetry means that
-- row/col and col/row patterns will match (at least, that is, if they
-- are calculated sympathetically), halving the setup cost.
-- The data is just the number of moves made before this pattern was
-- first encountered, in a breadth-first search, backwards from the
-- goal state, until all patterns have been enumerated.
-- (The same ideas/vars are now also used for stm metrics when MTM=0)
--</span>
<span style="color: #004080;">sequence</span> <span style="color: #000000;">wdkey</span> <span style="color: #000080;font-style:italic;">-- one such 4x4 pattern</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">mmwd</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">new_dict<span style="color: #0000FF;">(<span style="color: #0000FF;">)</span> <span style="color: #000080;font-style:italic;">-- lookup table, data is walking distance.
--
-- We use two to-do lists: todo is the current list, and everything
-- of walkingdistance+1 ends up on tdnx. Once todo is exhausted, we
-- swap the dictionary-ids, so tdnx automatically becomes empty.
-- Key is an mmwd pattern as above, and data is {distance,space_idx}.
--</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">todo</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">new_dict<span style="color: #0000FF;">(<span style="color: #0000FF;">)</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">tdnx</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">new_dict<span style="color: #0000FF;">(<span style="color: #0000FF;">)</span>
<span style="color: #000080;font-style:italic;">--</span>
<span style="color: #008080;">enum</span> <span style="color: #000000;">UP</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">1<span style="color: #0000FF;">,</span> <span style="color: #000000;">DOWN</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">-<span style="color: #000000;">1</span>
<span style="color: #008080;">procedure</span> <span style="color: #000000;">explore<span style="color: #0000FF;">(<span style="color: #004080;">integer</span> <span style="color: #000000;">space_idx<span style="color: #0000FF;">,</span> <span style="color: #000000;">walking_distance<span style="color: #0000FF;">,</span> <span style="color: #000000;">direction<span style="color: #0000FF;">)</span>
<span style="color: #000080;font-style:italic;">--
-- Given a space index, explore all the possible moves in direction,
-- setting the distance and extending the tdnx table.
--</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">tile_idx</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">space_idx<span style="color: #0000FF;">+<span style="color: #000000;">direction</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">group<span style="color: #0000FF;">=<span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #000000;">SIZE</span> <span style="color: #008080;">do</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">wdkey<span style="color: #0000FF;">[<span style="color: #000000;">tile_idx<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">group<span style="color: #0000FF;">]</span> <span style="color: #008080;">then</span>
<span style="color: #000080;font-style:italic;">-- ie: check row tile_idx for tiles belonging to rows 1..4
-- Swap one of those tiles with the space</span>
<span style="color: #000000;">wdkey<span style="color: #0000FF;">[<span style="color: #000000;">tile_idx<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">group<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">-=</span> <span style="color: #000000;">1</span>
<span style="color: #000000;">wdkey<span style="color: #0000FF;">[<span style="color: #000000;">space_idx<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">group<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span>
<span style="color: #008080;">if</span> <span style="color: #7060A8;">getd_index<span style="color: #0000FF;">(<span style="color: #000000;">wdkey<span style="color: #0000FF;">,<span style="color: #000000;">mmwd<span style="color: #0000FF;">)<span style="color: #0000FF;">=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span>
<span style="color: #000080;font-style:italic;">-- save the walking distance value</span>
<span style="color: #7060A8;">setd<span style="color: #0000FF;">(<span style="color: #000000;">wdkey<span style="color: #0000FF;">,<span style="color: #000000;">walking_distance<span style="color: #0000FF;">+<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">mmwd<span style="color: #0000FF;">)</span>
<span style="color: #000080;font-style:italic;">-- and add to the todo next list:</span>
<span style="color: #008080;">if</span> <span style="color: #7060A8;">getd_index<span style="color: #0000FF;">(<span style="color: #000000;">wdkey<span style="color: #0000FF;">,<span style="color: #000000;">tdnx<span style="color: #0000FF;">)<span style="color: #0000FF;">!=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span> <span style="color: #0000FF;">?<span style="color: #000000;">9<span style="color: #0000FF;">/<span style="color: #000000;">0</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #7060A8;">setd<span style="color: #0000FF;">(<span style="color: #000000;">wdkey<span style="color: #0000FF;">,<span style="color: #0000FF;">{<span style="color: #000000;">walking_distance<span style="color: #0000FF;">+<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">tile_idx<span style="color: #0000FF;">}<span style="color: #0000FF;">,<span style="color: #000000;">tdnx<span style="color: #0000FF;">)</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">MTM</span> <span style="color: #008080;">then</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">tile_idx<span style="color: #0000FF;">><span style="color: #000000;">1</span> <span style="color: #008080;">and</span> <span style="color: #000000;">tile_idx<span style="color: #0000FF;"><<span style="color: #000000;">SIZE</span> <span style="color: #008080;">then</span>
<span style="color: #000080;font-style:italic;">-- mtm: same direction means same distance:</span>
<span style="color: #000000;">explore<span style="color: #0000FF;">(<span style="color: #000000;">tile_idx<span style="color: #0000FF;">,</span> <span style="color: #000000;">walking_distance<span style="color: #0000FF;">,</span> <span style="color: #000000;">direction<span style="color: #0000FF;">)</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000080;font-style:italic;">-- Revert the swap so we can look at the next candidate.</span>
<span style="color: #000000;">wdkey<span style="color: #0000FF;">[<span style="color: #000000;">tile_idx<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">group<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span>
<span style="color: #000000;">wdkey<span style="color: #0000FF;">[<span style="color: #000000;">space_idx<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">group<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">-=</span> <span style="color: #000000;">1</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
<span style="color: #008080;">procedure</span> <span style="color: #000000;">generate_mmwd<span style="color: #0000FF;">(<span style="color: #0000FF;">)</span>
<span style="color: #000080;font-style:italic;">-- Perform a breadth-first search begining with the solved puzzle state
-- and exploring from there until no more new patterns emerge.</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">walking_distance</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">space</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">4</span>
<span style="color: #000000;">wdkey</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{<span style="color: #0000FF;">{<span style="color: #000000;">4<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #000080;font-style:italic;">-- \</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">4<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #000080;font-style:italic;">-- } 4 tiles in correct row positions</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">4<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #000080;font-style:italic;">-- /</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">3<span style="color: #0000FF;">}<span style="color: #0000FF;">}</span> <span style="color: #000080;font-style:italic;">-- 3 tiles in correct row position</span>
<span style="color: #7060A8;">setd<span style="color: #0000FF;">(<span style="color: #000000;">wdkey<span style="color: #0000FF;">,<span style="color: #000000;">walking_distance<span style="color: #0000FF;">,<span style="color: #000000;">mmwd<span style="color: #0000FF;">)</span>
<span style="color: #008080;">while</span> <span style="color: #000000;">1</span> <span style="color: #008080;">do</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">space<span style="color: #0000FF;"><<span style="color: #000000;">4</span> <span style="color: #008080;">then</span> <span style="color: #000000;">explore<span style="color: #0000FF;">(<span style="color: #000000;">space<span style="color: #0000FF;">,</span> <span style="color: #000000;">walking_distance<span style="color: #0000FF;">,</span> <span style="color: #000000;">UP<span style="color: #0000FF;">)</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">space<span style="color: #0000FF;">><span style="color: #000000;">1</span> <span style="color: #008080;">then</span> <span style="color: #000000;">explore<span style="color: #0000FF;">(<span style="color: #000000;">space<span style="color: #0000FF;">,</span> <span style="color: #000000;">walking_distance<span style="color: #0000FF;">,</span> <span style="color: #000000;">DOWN<span style="color: #0000FF;">)</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">if</span> <span style="color: #7060A8;">dict_size<span style="color: #0000FF;">(<span style="color: #000000;">todo<span style="color: #0000FF;">)<span style="color: #0000FF;">=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span>
<span style="color: #008080;">if</span> <span style="color: #7060A8;">dict_size<span style="color: #0000FF;">(<span style="color: #000000;">tdnx<span style="color: #0000FF;">)<span style="color: #0000FF;">=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span> <span style="color: #008080;">exit</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #0000FF;">{<span style="color: #000000;">todo<span style="color: #0000FF;">,<span style="color: #000000;">tdnx<span style="color: #0000FF;">}</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{<span style="color: #000000;">tdnx<span style="color: #0000FF;">,<span style="color: #000000;">todo<span style="color: #0000FF;">}</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000000;">wdkey</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">getd_partial_key<span style="color: #0000FF;">(<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">todo<span style="color: #0000FF;">)</span>
<span style="color: #0000FF;">{<span style="color: #000000;">walking_distance<span style="color: #0000FF;">,<span style="color: #000000;">space<span style="color: #0000FF;">}</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">getd<span style="color: #0000FF;">(<span style="color: #000000;">wdkey<span style="color: #0000FF;">,<span style="color: #000000;">todo<span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">deld<span style="color: #0000FF;">(<span style="color: #000000;">wdkey<span style="color: #0000FF;">,<span style="color: #000000;">todo<span style="color: #0000FF;">)</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">while</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
<span style="color: #008080;">function</span> <span style="color: #000000;">walking_distance<span style="color: #0000FF;">(<span style="color: #004080;">sequence</span> <span style="color: #000000;">puzzle<span style="color: #0000FF;">)</span>
<span style="color: #004080;">sequence</span> <span style="color: #000000;">rkey</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">repeat<span style="color: #0000FF;">(<span style="color: #7060A8;">repeat<span style="color: #0000FF;">(<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">SIZE<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #000000;">SIZE<span style="color: #0000FF;">)<span style="color: #0000FF;">,</span>
<span style="color: #000000;">ckey</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">repeat<span style="color: #0000FF;">(<span style="color: #7060A8;">repeat<span style="color: #0000FF;">(<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">SIZE<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #000000;">SIZE<span style="color: #0000FF;">)</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">k</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">1</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">i<span style="color: #0000FF;">=<span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #000000;">SIZE</span> <span style="color: #008080;">do</span> <span style="color: #000080;font-style:italic;">-- rows</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">j<span style="color: #0000FF;">=<span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #000000;">SIZE</span> <span style="color: #008080;">do</span> <span style="color: #000080;font-style:italic;">-- columns</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">tile</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">k<span style="color: #0000FF;">]</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">tile<span style="color: #0000FF;">!=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">row</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">floor<span style="color: #0000FF;">(<span style="color: #0000FF;">(<span style="color: #000000;">tile<span style="color: #0000FF;">-<span style="color: #000000;">1<span style="color: #0000FF;">)<span style="color: #0000FF;">/<span style="color: #000000;">4<span style="color: #0000FF;">)<span style="color: #0000FF;">+<span style="color: #000000;">1<span style="color: #0000FF;">,</span>
<span style="color: #000000;">col</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">mod<span style="color: #0000FF;">(<span style="color: #000000;">tile<span style="color: #0000FF;">-<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">4<span style="color: #0000FF;">)<span style="color: #0000FF;">+<span style="color: #000000;">1</span>
<span style="color: #000000;">rkey<span style="color: #0000FF;">[<span style="color: #000000;">i<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">row<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span>
<span style="color: #000000;">ckey<span style="color: #0000FF;">[<span style="color: #000000;">j<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">col<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000000;">k</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">if</span> <span style="color: #7060A8;">getd_index<span style="color: #0000FF;">(<span style="color: #000000;">rkey<span style="color: #0000FF;">,<span style="color: #000000;">mmwd<span style="color: #0000FF;">)<span style="color: #0000FF;">=<span style="color: #000000;">0</span>
<span style="color: #008080;">or</span> <span style="color: #7060A8;">getd_index<span style="color: #0000FF;">(<span style="color: #000000;">ckey<span style="color: #0000FF;">,<span style="color: #000000;">mmwd<span style="color: #0000FF;">)<span style="color: #0000FF;">=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span>
<span style="color: #0000FF;">?<span style="color: #000000;">9<span style="color: #0000FF;">/<span style="color: #000000;">0</span> <span style="color: #000080;font-style:italic;">-- sanity check</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">rwd</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">getd<span style="color: #0000FF;">(<span style="color: #000000;">rkey<span style="color: #0000FF;">,<span style="color: #000000;">mmwd<span style="color: #0000FF;">)<span style="color: #0000FF;">,</span>
<span style="color: #000000;">cwd</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">getd<span style="color: #0000FF;">(<span style="color: #000000;">ckey<span style="color: #0000FF;">,<span style="color: #000000;">mmwd<span style="color: #0000FF;">)</span>
<span style="color: #008080;">return</span> <span style="color: #000000;">rwd<span style="color: #0000FF;">+<span style="color: #000000;">cwd</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
<span style="color: #004080;">sequence</span> <span style="color: #000000;">puzzle</span>
<span style="color: #004080;">string</span> <span style="color: #000000;">res</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">""</span>
<span style="color: #004080;">atom</span> <span style="color: #000000;">t0</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">,</span>
<span style="color: #000000;">t1</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">+<span style="color: #000000;">1</span>
<span style="color: #004080;">atom</span> <span style="color: #000000;">tries</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">ok</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{<span style="color: #0000FF;">{<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #000080;font-style:italic;">-- left</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #000080;font-style:italic;">-- up</span>
<span style="color: #0000FF;">{<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #000080;font-style:italic;">-- down</span>
<span style="color: #0000FF;">{<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">0<span style="color: #0000FF;">}<span style="color: #0000FF;">}</span> <span style="color: #000080;font-style:italic;">-- right
<!--</syntaxhighlight>-->
 
<!--<syntaxhighlight lang="phix">-->
<span style="color: #008080;">function</span> <span style="color: #000000;">iddfs<span style="color: #0000FF;">(<span style="color: #004080;">integer</span> <span style="color: #000000;">step<span style="color: #0000FF;">,</span> <span style="color: #000000;">lim<span style="color: #0000FF;">,</span> <span style="color: #000000;">space<span style="color: #0000FF;">,</span> <span style="color: #000000;">prevmv<span style="color: #0000FF;">)</span>
<span style="color: #008080;">if</span> <span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">><span style="color: #000000;">t1</span> <span style="color: #008080;">then</span>
<span style="color: #7060A8;">printf<span style="color: #0000FF;">(<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #008000;">"working... (depth=%d, tries=%d, time=%3ds)\r"<span style="color: #0000FF;">,<span style="color: #0000FF;">{<span style="color: #000000;">lim<span style="color: #0000FF;">,<span style="color: #000000;">tries<span style="color: #0000FF;">,<span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">-<span style="color: #000000;">t0<span style="color: #0000FF;">}<span style="color: #0000FF;">)</span>
<span style="color: #000000;">t1</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">+<span style="color: #000000;">1</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000000;">tries</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">d</span> <span style="color: #0000FF;">=</span> <span style="color: #008080;">iff<span style="color: #0000FF;">(<span style="color: #000000;">step<span style="color: #0000FF;">==<span style="color: #000000;">lim<span style="color: #0000FF;">?<span style="color: #000000;">0<span style="color: #0000FF;">:<span style="color: #000000;">walking_distance<span style="color: #0000FF;">(<span style="color: #000000;">puzzle<span style="color: #0000FF;">)<span style="color: #0000FF;">)</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">d<span style="color: #0000FF;">=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span>
<span style="color: #008080;">return</span> <span style="color: #0000FF;">(<span style="color: #000000;">puzzle<span style="color: #0000FF;">==<span style="color: #000000;">goal<span style="color: #0000FF;">)</span>
<span style="color: #008080;">elsif</span> <span style="color: #000000;">step<span style="color: #0000FF;">+<span style="color: #000000;">d<span style="color: #0000FF;"><=<span style="color: #000000;">lim</span> <span style="color: #008080;">then</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">mv<span style="color: #0000FF;">=<span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #000000;">4</span> <span style="color: #008080;">do</span> <span style="color: #000080;font-style:italic;">-- l/u/d/r</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">prevmv<span style="color: #0000FF;">!=<span style="color: #0000FF;">(<span style="color: #000000;">5<span style="color: #0000FF;">-<span style="color: #000000;">mv<span style="color: #0000FF;">)</span> <span style="color: #000080;font-style:italic;">-- not l after r or vice versa, ditto u/d</span>
<span style="color: #008080;">and</span> <span style="color: #000000;">ok<span style="color: #0000FF;">[<span style="color: #000000;">mv<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]</span> <span style="color: #008080;">then</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">nspace</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">space<span style="color: #0000FF;">+<span style="color: #0000FF;">{<span style="color: #0000FF;">-<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #0000FF;">-<span style="color: #000000;">4<span style="color: #0000FF;">,<span style="color: #0000FF;">+<span style="color: #000000;">4<span style="color: #0000FF;">,<span style="color: #0000FF;">+<span style="color: #000000;">1<span style="color: #0000FF;">}<span style="color: #0000FF;">[<span style="color: #000000;">mv<span style="color: #0000FF;">]</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">tile</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">nspace<span style="color: #0000FF;">]</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]<span style="color: #0000FF;">!=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span> <span style="color: #0000FF;">?<span style="color: #000000;">9<span style="color: #0000FF;">/<span style="color: #000000;">0</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span> <span style="color: #000080;font-style:italic;">-- sanity check </span>
<span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">tile</span>
<span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">nspace<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">iddfs<span style="color: #0000FF;">(<span style="color: #000000;">step<span style="color: #0000FF;">+<span style="color: #008080;">iff<span style="color: #0000FF;">(<span style="color: #000000;">MTM</span> <span style="color: #008080;">or</span> <span style="color: #008080;">not</span> <span style="color: #000000;">STM<span style="color: #0000FF;">?<span style="color: #0000FF;">(<span style="color: #000000;">prevmv<span style="color: #0000FF;">!=<span style="color: #000000;">mv<span style="color: #0000FF;">)<span style="color: #0000FF;">:<span style="color: #000000;">1<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #000000;">lim<span style="color: #0000FF;">,<span style="color: #000000;">nspace<span style="color: #0000FF;">,<span style="color: #000000;">mv<span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span>
<span style="color: #000000;">res</span> <span style="color: #0000FF;">&=</span> <span style="color: #008000;">"ludr"<span style="color: #0000FF;">[<span style="color: #000000;">mv<span style="color: #0000FF;">]</span>
<span style="color: #008080;">return</span> <span style="color: #004600;">true</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">nspace<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">tile</span>
<span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">return</span> <span style="color: #004600;">false</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
<span style="color: #008080;">function</span> <span style="color: #000000;">pack<span style="color: #0000FF;">(<span style="color: #004080;">string</span> <span style="color: #000000;">s<span style="color: #0000FF;">)</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">n</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">length<span style="color: #0000FF;">(<span style="color: #000000;">s<span style="color: #0000FF;">)<span style="color: #0000FF;">,</span> <span style="color: #000000;">n0</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">n</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">i<span style="color: #0000FF;">=<span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #000000;">4</span> <span style="color: #008080;">do</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">ch</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"lrud"<span style="color: #0000FF;">[<span style="color: #000000;">i<span style="color: #0000FF;">]<span style="color: #0000FF;">,</span> <span style="color: #000000;">k</span>
<span style="color: #008080;">while</span> <span style="color: #000000;">1</span> <span style="color: #008080;">do</span>
<span style="color: #000000;">k</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">match<span style="color: #0000FF;">(<span style="color: #7060A8;">repeat<span style="color: #0000FF;">(<span style="color: #000000;">ch<span style="color: #0000FF;">,<span style="color: #000000;">3<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #000000;">s<span style="color: #0000FF;">)</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">k<span style="color: #0000FF;">=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span> <span style="color: #008080;">exit</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000000;">s<span style="color: #0000FF;">[<span style="color: #000000;">k<span style="color: #0000FF;">+<span style="color: #000000;">1<span style="color: #0000FF;">..<span style="color: #000000;">k<span style="color: #0000FF;">+<span style="color: #000000;">2<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"3"</span>
<span style="color: #000000;">n</span> <span style="color: #0000FF;">-=</span> <span style="color: #000000;">2</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">while</span>
<span style="color: #008080;">while</span> <span style="color: #000000;">1</span> <span style="color: #008080;">do</span>
<span style="color: #000000;">k</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">match<span style="color: #0000FF;">(<span style="color: #7060A8;">repeat<span style="color: #0000FF;">(<span style="color: #000000;">ch<span style="color: #0000FF;">,<span style="color: #000000;">2<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #000000;">s<span style="color: #0000FF;">)</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">k<span style="color: #0000FF;">=<span style="color: #000000;">0</span> <span style="color: #008080;">then</span> <span style="color: #008080;">exit</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000000;">s<span style="color: #0000FF;">[<span style="color: #000000;">k<span style="color: #0000FF;">+<span style="color: #000000;">1<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">'2'</span>
<span style="color: #000000;">n</span> <span style="color: #0000FF;">-=</span> <span style="color: #000000;">1</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">while</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">return</span> <span style="color: #0000FF;">{<span style="color: #000000;">n<span style="color: #0000FF;">,<span style="color: #008080;">iff<span style="color: #0000FF;">(<span style="color: #000000;">MTM<span style="color: #0000FF;">?<span style="color: #7060A8;">sprintf<span style="color: #0000FF;">(<span style="color: #008000;">"%d"<span style="color: #0000FF;">,<span style="color: #000000;">n<span style="color: #0000FF;">)<span style="color: #0000FF;">:<span style="color: #7060A8;">sprintf<span style="color: #0000FF;">(<span style="color: #008000;">"%d(%d)"<span style="color: #0000FF;">,<span style="color: #0000FF;">{<span style="color: #000000;">n<span style="color: #0000FF;">,<span style="color: #000000;">n0<span style="color: #0000FF;">}<span style="color: #0000FF;">)<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #000000;">s<span style="color: #0000FF;">}</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
<span style="color: #008080;">procedure</span> <span style="color: #000000;">apply_moves<span style="color: #0000FF;">(<span style="color: #004080;">string</span> <span style="color: #000000;">moves<span style="color: #0000FF;">,</span> <span style="color: #004080;">integer</span> <span style="color: #000000;">space<span style="color: #0000FF;">)</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">move<span style="color: #0000FF;">,</span> <span style="color: #000000;">ch<span style="color: #0000FF;">,</span> <span style="color: #000000;">nspace</span>
<span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">i<span style="color: #0000FF;">=<span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #7060A8;">length<span style="color: #0000FF;">(<span style="color: #000000;">moves<span style="color: #0000FF;">)</span> <span style="color: #008080;">do</span>
<span style="color: #000000;">ch</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">moves<span style="color: #0000FF;">[<span style="color: #000000;">i<span style="color: #0000FF;">]</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">ch<span style="color: #0000FF;">><span style="color: #008000;">'3'</span> <span style="color: #008080;">then</span>
<span style="color: #000000;">move</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">find<span style="color: #0000FF;">(<span style="color: #000000;">ch<span style="color: #0000FF;">,<span style="color: #008000;">"ulrd"<span style="color: #0000FF;">)</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000080;font-style:italic;">-- (hint: "r" -> the 'r' does 1
-- "r2" -> the 'r' does 1, the '2' does 1
-- "r3" -> the 'r' does 1, the '3' does 2!)</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">j<span style="color: #0000FF;">=<span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #000000;">1<span style="color: #0000FF;">+<span style="color: #0000FF;">(<span style="color: #000000;">ch<span style="color: #0000FF;">=<span style="color: #008000;">'3'<span style="color: #0000FF;">)</span> <span style="color: #008080;">do</span>
<span style="color: #000000;">nspace</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">space<span style="color: #0000FF;">+<span style="color: #0000FF;">{<span style="color: #0000FF;">-<span style="color: #000000;">4<span style="color: #0000FF;">,<span style="color: #0000FF;">-<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #0000FF;">+<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">4<span style="color: #0000FF;">}<span style="color: #0000FF;">[<span style="color: #000000;">move<span style="color: #0000FF;">]</span>
<span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">nspace<span style="color: #0000FF;">]</span>
<span style="color: #000000;">space</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">nspace</span>
<span style="color: #000000;">puzzle<span style="color: #0000FF;">[<span style="color: #000000;">nspace<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
<span style="color: #008080;">function</span> <span style="color: #000000;">solvable<span style="color: #0000FF;">(<span style="color: #004080;">sequence</span> <span style="color: #000000;">board<span style="color: #0000FF;">)</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">n</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">length<span style="color: #0000FF;">(<span style="color: #000000;">board<span style="color: #0000FF;">)</span>
<span style="color: #004080;">sequence</span> <span style="color: #000000;">positions</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">repeat<span style="color: #0000FF;">(<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">n<span style="color: #0000FF;">)</span>
<span style="color: #000080;font-style:italic;">-- prepare the mapping from each tile to its position</span>
<span style="color: #000000;">board<span style="color: #0000FF;">[<span style="color: #7060A8;">find<span style="color: #0000FF;">(<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">board<span style="color: #0000FF;">)<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">n</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">i<span style="color: #0000FF;">=<span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #000000;">n</span> <span style="color: #008080;">do</span>
<span style="color: #000000;">positions<span style="color: #0000FF;">[<span style="color: #000000;">board<span style="color: #0000FF;">[<span style="color: #000000;">i<span style="color: #0000FF;">]<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">i</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #000080;font-style:italic;">-- check whether this is an even or odd state</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">row</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">floor<span style="color: #0000FF;">(<span style="color: #0000FF;">(<span style="color: #000000;">positions<span style="color: #0000FF;">[<span style="color: #000000;">16<span style="color: #0000FF;">]<span style="color: #0000FF;">-<span style="color: #000000;">1<span style="color: #0000FF;">)<span style="color: #0000FF;">/<span style="color: #000000;">4<span style="color: #0000FF;">)<span style="color: #0000FF;">,</span>
<span style="color: #000000;">col</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">(<span style="color: #000000;">positions<span style="color: #0000FF;">[<span style="color: #000000;">16<span style="color: #0000FF;">]<span style="color: #0000FF;">-<span style="color: #000000;">1<span style="color: #0000FF;">)<span style="color: #0000FF;">-<span style="color: #000000;">row<span style="color: #0000FF;">*<span style="color: #000000;">4</span>
<span style="color: #004080;">bool</span> <span style="color: #000000;">even_state</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">(<span style="color: #000000;">positions<span style="color: #0000FF;">[<span style="color: #000000;">16<span style="color: #0000FF;">]<span style="color: #0000FF;">==<span style="color: #000000;">16<span style="color: #0000FF;">)</span> <span style="color: #008080;">or</span> <span style="color: #0000FF;">(<span style="color: #7060A8;">mod<span style="color: #0000FF;">(<span style="color: #000000;">row<span style="color: #0000FF;">,<span style="color: #000000;">2<span style="color: #0000FF;">)<span style="color: #0000FF;">==<span style="color: #7060A8;">mod<span style="color: #0000FF;">(<span style="color: #000000;">col<span style="color: #0000FF;">,<span style="color: #000000;">2<span style="color: #0000FF;">)<span style="color: #0000FF;">)</span>
<span style="color: #000080;font-style:italic;">-- count the even cycles</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">even_count</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
<span style="color: #004080;">sequence</span> <span style="color: #000000;">visited</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">repeat<span style="color: #0000FF;">(<span style="color: #004600;">false<span style="color: #0000FF;">,<span style="color: #000000;">16<span style="color: #0000FF;">)</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">i<span style="color: #0000FF;">=<span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #000000;">n</span> <span style="color: #008080;">do</span>
<span style="color: #008080;">if</span> <span style="color: #008080;">not</span> <span style="color: #000000;">visited<span style="color: #0000FF;">[<span style="color: #000000;">i<span style="color: #0000FF;">]</span> <span style="color: #008080;">then</span>
<span style="color: #000080;font-style:italic;">-- a new cycle starts at i. Count its length..</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">cycle_length</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span>
<span style="color: #000000;">next_tile</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">i</span>
<span style="color: #008080;">while</span> <span style="color: #008080;">not</span> <span style="color: #000000;">visited<span style="color: #0000FF;">[<span style="color: #000000;">next_tile<span style="color: #0000FF;">]</span> <span style="color: #008080;">do</span>
<span style="color: #000000;">cycle_length</span> <span style="color: #0000FF;">+=<span style="color: #000000;">1</span>
<span style="color: #000000;">visited<span style="color: #0000FF;">[<span style="color: #000000;">next_tile<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">true</span>
<span style="color: #000000;">next_tile</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">positions<span style="color: #0000FF;">[<span style="color: #000000;">next_tile<span style="color: #0000FF;">]</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">while</span>
<span style="color: #000000;">even_count</span> <span style="color: #0000FF;">+=</span> <span style="color: #0000FF;">(<span style="color: #7060A8;">mod<span style="color: #0000FF;">(<span style="color: #000000;">cycle_length<span style="color: #0000FF;">,<span style="color: #000000;">2<span style="color: #0000FF;">)<span style="color: #0000FF;">==<span style="color: #000000;">0<span style="color: #0000FF;">)</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">return</span> <span style="color: #000000;">even_state</span> <span style="color: #0000FF;">==</span> <span style="color: #0000FF;">(<span style="color: #7060A8;">mod<span style="color: #0000FF;">(<span style="color: #000000;">even_count<span style="color: #0000FF;">,<span style="color: #000000;">2<span style="color: #0000FF;">)<span style="color: #0000FF;">==<span style="color: #000000;">0<span style="color: #0000FF;">)</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
<span style="color: #008080;">procedure</span> <span style="color: #000000;">main<span style="color: #0000FF;">(<span style="color: #0000FF;">)</span>
<span style="color: #000000;">puzzle</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{<span style="color: #000000;">15<span style="color: #0000FF;">,<span style="color: #000000;">14<span style="color: #0000FF;">,</span> <span style="color: #000000;">1<span style="color: #0000FF;">,</span> <span style="color: #000000;">6<span style="color: #0000FF;">,</span>
<span style="color: #000000;">9<span style="color: #0000FF;">,<span style="color: #000000;">11<span style="color: #0000FF;">,</span> <span style="color: #000000;">4<span style="color: #0000FF;">,<span style="color: #000000;">12<span style="color: #0000FF;">,</span>
<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">10<span style="color: #0000FF;">,</span> <span style="color: #000000;">7<span style="color: #0000FF;">,</span> <span style="color: #000000;">3<span style="color: #0000FF;">,</span>
<span style="color: #000000;">13<span style="color: #0000FF;">,</span> <span style="color: #000000;">8<span style="color: #0000FF;">,</span> <span style="color: #000000;">5<span style="color: #0000FF;">,</span> <span style="color: #000000;">2<span style="color: #0000FF;">}</span>
<span style="color: #008080;">if</span> <span style="color: #008080;">not</span> <span style="color: #000000;">solvable<span style="color: #0000FF;">(<span style="color: #000000;">puzzle<span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span>
<span style="color: #0000FF;">?<span style="color: #000000;">puzzle</span>
<span style="color: #7060A8;">printf<span style="color: #0000FF;">(<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #008000;">"puzzle is not solveable\n"<span style="color: #0000FF;">)</span>
<span style="color: #008080;">else</span>
<span style="color: #000000;">generate_mmwd<span style="color: #0000FF;">(<span style="color: #0000FF;">)</span>
<span style="color: #004080;">sequence</span> <span style="color: #000000;">original</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">puzzle</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">space</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">find<span style="color: #0000FF;">(<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">puzzle<span style="color: #0000FF;">)</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">lim<span style="color: #0000FF;">=<span style="color: #000000;">walking_distance<span style="color: #0000FF;">(<span style="color: #000000;">puzzle<span style="color: #0000FF;">)</span> <span style="color: #008080;">to</span> <span style="color: #008080;">iff<span style="color: #0000FF;">(<span style="color: #000000;">MTM<span style="color: #0000FF;">?<span style="color: #000000;">43<span style="color: #0000FF;">:<span style="color: #000000;">80<span style="color: #0000FF;">)</span> <span style="color: #008080;">do</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">iddfs<span style="color: #0000FF;">(<span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">lim<span style="color: #0000FF;">,</span> <span style="color: #000000;">space<span style="color: #0000FF;">,</span> <span style="color: #008000;">'-'<span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span> <span style="color: #008080;">exit</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #0000FF;">{<span style="color: #004080;">integer</span> <span style="color: #000000;">n<span style="color: #0000FF;">,</span> <span style="color: #004080;">string</span> <span style="color: #000000;">ns<span style="color: #0000FF;">,</span> <span style="color: #004080;">string</span> <span style="color: #000000;">ans<span style="color: #0000FF;">}</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">pack<span style="color: #0000FF;">(<span style="color: #7060A8;">reverse<span style="color: #0000FF;">(<span style="color: #000000;">res<span style="color: #0000FF;">)<span style="color: #0000FF;">)</span>
<span style="color: #7060A8;">printf<span style="color: #0000FF;">(<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #008000;">"\n\noriginal:"<span style="color: #0000FF;">)</span>
<span style="color: #0000FF;">?<span style="color: #000000;">original</span>
<span style="color: #004080;">atom</span> <span style="color: #000000;">t</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">-<span style="color: #000000;">t0</span>
<span style="color: #7060A8;">printf<span style="color: #0000FF;">(<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #008000;">"\n%soptimal solution of %s moves found in %s: %s\n\nresult: "<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #008080;">iff<span style="color: #0000FF;">(<span style="color: #000000;">MTM<span style="color: #0000FF;">?<span style="color: #008000;">"mtm-"<span style="color: #0000FF;">:<span style="color: #008080;">iff<span style="color: #0000FF;">(<span style="color: #000000;">STM<span style="color: #0000FF;">?<span style="color: #008000;">"stm-"<span style="color: #0000FF;">:<span style="color: #008000;">"non-"<span style="color: #0000FF;">)<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #000000;">ns<span style="color: #0000FF;">,<span style="color: #7060A8;">elapsed<span style="color: #0000FF;">(<span style="color: #000000;">t<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #000000;">ans<span style="color: #0000FF;">}<span style="color: #0000FF;">)</span>
<span style="color: #000000;">puzzle</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">original</span>
<span style="color: #000000;">apply_moves<span style="color: #0000FF;">(<span style="color: #000000;">ans<span style="color: #0000FF;">,<span style="color: #000000;">space<span style="color: #0000FF;">)</span>
<span style="color: #0000FF;">?<span style="color: #000000;">puzzle</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
<span style="color: #000000;">main<span style="color: #0000FF;">(<span style="color: #0000FF;">)
<!--</syntaxhighlight>-->
{{out}}
<pre>
Line 2,212 ⟶ 7,878:
stm-optimal solution of 38(52) moves found in 1 minute and 54s: r3uldlu2ldrurd3lu2lur3dld2ruldlu2rd2lulur2uldr2d2
mtm-optimal solution of 31(60) moves found in 2 hours, 38 minutes and 28s: u2r2d3ru2ld2ru3ld3l2u3r2d2l2dru3rd3l2u2r3dl3dru2r2d2
</pre>
 
=== simpler, better ===
The basic algorithm (credit Nigel Galloway) is just
let all moves which do not increase the manhattan cost be regarded as "free".
-- (if you can solve in mc, clearly it is an optimal solution)
let n=0
while (not solveable_with_at_most_n_non_free_moves(n)) n++
-- (clearly optimal by exhaustively disproving all lesser n)
 
<!--<syntaxhighlight lang="phix">(phixonline)-->
<span style="color: #000080;font-style:italic;">-- demo/rosetta/Solve15puzzle_simple.exw</span>
<span style="color: #008080;">enum</span> <span style="color: #000000;">left<span style="color: #0000FF;">,</span> <span style="color: #000000;">down<span style="color: #0000FF;">,</span> <span style="color: #000000;">up<span style="color: #0000FF;">,</span> <span style="color: #000000;">right</span> <span style="color: #000080;font-style:italic;">-- (nb 5-move flips it, as in down===5-up, etc)</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">valid_moves</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{<span style="color: #0000FF;">{</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">5<span style="color: #0000FF;">,</span> <span style="color: #000000;">2<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{</span> <span style="color: #000000;">1<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">6<span style="color: #0000FF;">,</span> <span style="color: #000000;">3<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{</span> <span style="color: #000000;">2<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">7<span style="color: #0000FF;">,</span> <span style="color: #000000;">4<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{</span> <span style="color: #000000;">3<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">8<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">1<span style="color: #0000FF;">,</span> <span style="color: #000000;">9<span style="color: #0000FF;">,</span> <span style="color: #000000;">6<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{</span> <span style="color: #000000;">5<span style="color: #0000FF;">,</span> <span style="color: #000000;">2<span style="color: #0000FF;">,<span style="color: #000000;">10<span style="color: #0000FF;">,</span> <span style="color: #000000;">7<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{</span> <span style="color: #000000;">6<span style="color: #0000FF;">,</span> <span style="color: #000000;">3<span style="color: #0000FF;">,<span style="color: #000000;">11<span style="color: #0000FF;">,</span> <span style="color: #000000;">8<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{</span> <span style="color: #000000;">7<span style="color: #0000FF;">,</span> <span style="color: #000000;">4<span style="color: #0000FF;">,<span style="color: #000000;">12<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">5<span style="color: #0000FF;">,<span style="color: #000000;">13<span style="color: #0000FF;">,<span style="color: #000000;">10<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{</span> <span style="color: #000000;">9<span style="color: #0000FF;">,</span> <span style="color: #000000;">6<span style="color: #0000FF;">,<span style="color: #000000;">14<span style="color: #0000FF;">,<span style="color: #000000;">11<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{<span style="color: #000000;">10<span style="color: #0000FF;">,</span> <span style="color: #000000;">7<span style="color: #0000FF;">,<span style="color: #000000;">15<span style="color: #0000FF;">,<span style="color: #000000;">12<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{<span style="color: #000000;">11<span style="color: #0000FF;">,</span> <span style="color: #000000;">8<span style="color: #0000FF;">,<span style="color: #000000;">16<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">9<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">14<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{<span style="color: #000000;">13<span style="color: #0000FF;">,<span style="color: #000000;">10<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">15<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{<span style="color: #000000;">14<span style="color: #0000FF;">,<span style="color: #000000;">11<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">16<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span> <span style="color: #0000FF;">{<span style="color: #000000;">15<span style="color: #0000FF;">,<span style="color: #000000;">12<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">}<span style="color: #0000FF;">}</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">zero_cost</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{<span style="color: #0000FF;">{<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000001111<span style="color: #0000FF;">,<span style="color: #000000;">0b001000100010001<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b110111011101110<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000001111<span style="color: #0000FF;">,<span style="color: #000000;">0b011001100110011<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b100110011001100<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000001111<span style="color: #0000FF;">,<span style="color: #000000;">0b111011101110111<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b000100010001000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000001111<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b111111111110000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000011111111<span style="color: #0000FF;">,<span style="color: #000000;">0b001000100010001<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b110111011101110<span style="color: #0000FF;">,<span style="color: #000000;">0b111111111110000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000011111111<span style="color: #0000FF;">,<span style="color: #000000;">0b011001100110011<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b100110011001100<span style="color: #0000FF;">,<span style="color: #000000;">0b111111111110000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000011111111<span style="color: #0000FF;">,<span style="color: #000000;">0b111011101110111<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b000100010001000<span style="color: #0000FF;">,<span style="color: #000000;">0b111111111110000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000011111111<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b111111100000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000111111111111<span style="color: #0000FF;">,<span style="color: #000000;">0b001000100010001<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b110111011101110<span style="color: #0000FF;">,<span style="color: #000000;">0b111111100000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000111111111111<span style="color: #0000FF;">,<span style="color: #000000;">0b011001100110011<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b100110011001100<span style="color: #0000FF;">,<span style="color: #000000;">0b111111100000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000111111111111<span style="color: #0000FF;">,<span style="color: #000000;">0b111011101110111<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b000100010001000<span style="color: #0000FF;">,<span style="color: #000000;">0b111111100000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000111111111111<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b111000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b001000100010001<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b110111011101110<span style="color: #0000FF;">,<span style="color: #000000;">0b111000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b011001100110011<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b100110011001100<span style="color: #0000FF;">,<span style="color: #000000;">0b111000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b111011101110111<span style="color: #0000FF;">}<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #000000;">0b000100010001000<span style="color: #0000FF;">,<span style="color: #000000;">0b111000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000000<span style="color: #0000FF;">}<span style="color: #0000FF;">}</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">masks</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{<span style="color: #000000;">0b000000000000001<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000010<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000000100<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000001000<span style="color: #0000FF;">,</span>
<span style="color: #000000;">0b000000000010000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000000100000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000001000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000000010000000<span style="color: #0000FF;">,</span>
<span style="color: #000000;">0b000000100000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000001000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000010000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b000100000000000<span style="color: #0000FF;">,</span>
<span style="color: #000000;">0b001000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b010000000000000<span style="color: #0000FF;">,<span style="color: #000000;">0b100000000000000<span style="color: #0000FF;">}</span>
<span style="color: #000080;font-style:italic;">-- Or, if you prefer to build those with code (but I really wanted to show the above bitmasks):
--/*
sequence valid_moves = repeat(repeat(0,4),16),
zero_cost = repeat(repeat(0,4),16)
constant masks = sq_power(2,tagset(14,0))
for square=1 to 16 do
integer s_row = floor((square+3)/4),
s_col = remainder((square-1),4)+1
for move=left to right do -- (via up/down)
if (move=left and s_col>1)
or (move=down and s_row>1)
or (move=up and s_row<4)
or (move=right and s_col<4) then
integer origin = square+{-1,-4,+4,+1}[move],
o_row = floor((origin+3)/4),
o_col = remainder((origin-1),4)+1
valid_moves[square][move] = origin
for piece=1 to 15 do -- (aka target)
integer t_row = floor((piece+3)/4),
t_col = remainder((piece-1),4)+1,
p_md = abs(t_row-o_row)+abs(t_col-o_col),
n_md = abs(t_row-s_row)+abs(t_col-s_col)
if n_md<=p_md then
zero_cost[square][move] += masks[piece]
end if
end for
end if
end for
end for
--pp(valid_moves,{pp_IntFmt,"%2d",pp_Maxlen,70})
--pp(zero_cost,{pp_IntFmt,"%015b"})
--pp(masks,{pp_IntFmt,"%015b",pp_IntCh,false})
--*/</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">up</span> <span style="color: #008080;">or</span> <span style="color: #000000;">down</span> <span style="color: #008080;">then</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span> <span style="color: #000080;font-style:italic;">-- (suppress unused warnings, since the above commented out)</span>
<span style="color: #004080;">string</span> <span style="color: #000000;">moves</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">""</span>
<span style="color: #004080;">sequence</span> <span style="color: #000000;">board</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{<span style="color: #000000;">15<span style="color: #0000FF;">,<span style="color: #000000;">14<span style="color: #0000FF;">,</span> <span style="color: #000000;">1<span style="color: #0000FF;">,</span> <span style="color: #000000;">6<span style="color: #0000FF;">,</span>
<span style="color: #000000;">9<span style="color: #0000FF;">,<span style="color: #000000;">11<span style="color: #0000FF;">,</span> <span style="color: #000000;">4<span style="color: #0000FF;">,<span style="color: #000000;">12<span style="color: #0000FF;">,</span>
<span style="color: #000000;">0<span style="color: #0000FF;">,<span style="color: #000000;">10<span style="color: #0000FF;">,</span> <span style="color: #000000;">7<span style="color: #0000FF;">,</span> <span style="color: #000000;">3<span style="color: #0000FF;">,</span>
<span style="color: #000000;">13<span style="color: #0000FF;">,</span> <span style="color: #000000;">8<span style="color: #0000FF;">,</span> <span style="color: #000000;">5<span style="color: #0000FF;">,</span> <span style="color: #000000;">2<span style="color: #0000FF;">}</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">space</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">9</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">goal</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{</span> <span style="color: #000000;">1<span style="color: #0000FF;">,</span> <span style="color: #000000;">2<span style="color: #0000FF;">,</span> <span style="color: #000000;">3<span style="color: #0000FF;">,</span> <span style="color: #000000;">4<span style="color: #0000FF;">,</span>
<span style="color: #000000;">5<span style="color: #0000FF;">,</span> <span style="color: #000000;">6<span style="color: #0000FF;">,</span> <span style="color: #000000;">7<span style="color: #0000FF;">,</span> <span style="color: #000000;">8<span style="color: #0000FF;">,</span>
<span style="color: #000000;">9<span style="color: #0000FF;">,<span style="color: #000000;">10<span style="color: #0000FF;">,<span style="color: #000000;">11<span style="color: #0000FF;">,<span style="color: #000000;">12<span style="color: #0000FF;">,</span>
<span style="color: #000000;">13<span style="color: #0000FF;">,<span style="color: #000000;">14<span style="color: #0000FF;">,<span style="color: #000000;">15<span style="color: #0000FF;">,</span> <span style="color: #000000;">0<span style="color: #0000FF;">}</span>
<span style="color: #004080;">atom</span> <span style="color: #000000;">t1</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">+<span style="color: #000000;">1</span>
<span style="color: #008080;">function</span> <span style="color: #000000;">solve<span style="color: #0000FF;">(<span style="color: #004080;">integer</span> <span style="color: #000000;">nfree<span style="color: #0000FF;">,</span> <span style="color: #000000;">space<span style="color: #0000FF;">,</span> <span style="color: #000000;">mdx<span style="color: #0000FF;">=<span style="color: #000000;">1<span style="color: #0000FF;">,</span> <span style="color: #000000;">skip_move<span style="color: #0000FF;">=<span style="color: #000000;">0<span style="color: #0000FF;">)</span>
<span style="color: #000080;font-style:italic;">--
-- nfree is the number of non-free moves we can yet make
-- space is the location of the space (duh), [1..16]
-- mdx is just the move index for building the solution
-- skip_move significantly narrows search space (1000 or
-- more times faster, believe it or not, simply by not
-- allowing the immediate undoing of the last move)
--</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">move<span style="color: #0000FF;">=<span style="color: #000000;">left</span> <span style="color: #008080;">to</span> <span style="color: #000000;">right</span> <span style="color: #008080;">do</span> <span style="color: #000080;font-style:italic;">-- (via up/down)</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">new_space</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">valid_moves<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">move<span style="color: #0000FF;">]</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">move<span style="color: #0000FF;">!=<span style="color: #000000;">skip_move</span> <span style="color: #008080;">and</span> <span style="color: #000000;">new_space</span> <span style="color: #008080;">then</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">piece</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">board<span style="color: #0000FF;">[<span style="color: #000000;">new_space<span style="color: #0000FF;">]<span style="color: #0000FF;">,</span>
<span style="color: #000000;">zcsmv</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">zero_cost<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]<span style="color: #0000FF;">[<span style="color: #000000;">move<span style="color: #0000FF;">]<span style="color: #0000FF;">,</span>
<span style="color: #000000;">maskp</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">masks<span style="color: #0000FF;">[<span style="color: #000000;">piece<span style="color: #0000FF;">]<span style="color: #0000FF;">,</span>
<span style="color: #000000;">zcost</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">(<span style="color: #000000;">and_bits<span style="color: #0000FF;">(<span style="color: #000000;">zcsmv<span style="color: #0000FF;">,<span style="color: #000000;">maskp<span style="color: #0000FF;">)<span style="color: #0000FF;">=<span style="color: #000000;">0<span style="color: #0000FF;">)</span> <span style="color: #000080;font-style:italic;">-- (0==free, 1==not)</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">nfree<span style="color: #0000FF;">>=<span style="color: #000000;">zcost</span> <span style="color: #008080;">then</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">mdx<span style="color: #0000FF;">><span style="color: #7060A8;">length<span style="color: #0000FF;">(<span style="color: #000000;">moves<span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span> <span style="color: #000000;">moves</span> <span style="color: #0000FF;">&=</span> <span style="color: #008000;">'?'</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000080;font-style:italic;">-- moves[mdx] = "ludr"[move]</span>
<span style="color: #000000;">moves<span style="color: #0000FF;">[<span style="color: #000000;">mdx<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"ludrLUDR"<span style="color: #0000FF;">[<span style="color: #000000;">move<span style="color: #0000FF;">+<span style="color: #000000;">zcost<span style="color: #0000FF;">*<span style="color: #000000;">4<span style="color: #0000FF;">]</span>
<span style="color: #000000;">board<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">piece</span>
<span style="color: #000000;">board<span style="color: #0000FF;">[<span style="color: #000000;">new_space<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
<span style="color: #008080;">if</span> <span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">><span style="color: #000000;">t1</span> <span style="color: #008080;">then</span>
<span style="color: #7060A8;">printf<span style="color: #0000FF;">(<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #008000;">"%s\r"<span style="color: #0000FF;">,<span style="color: #0000FF;">{<span style="color: #000000;">moves<span style="color: #0000FF;">}<span style="color: #0000FF;">)</span>
<span style="color: #000000;">t1</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">+<span style="color: #000000;">1</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">space<span style="color: #0000FF;">=<span style="color: #000000;">piece</span> <span style="color: #008080;">and</span> <span style="color: #000000;">board<span style="color: #0000FF;">=<span style="color: #000000;">goal</span> <span style="color: #008080;">then</span>
<span style="color: #000000;">moves</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">moves<span style="color: #0000FF;">[<span style="color: #000000;">1<span style="color: #0000FF;">..<span style="color: #000000;">mdx<span style="color: #0000FF;">]</span> <span style="color: #000080;font-style:italic;">-- (trim)</span>
<span style="color: #008080;">return</span> <span style="color: #004600;">true</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">if</span> <span style="color: #000000;">solve<span style="color: #0000FF;">(<span style="color: #000000;">nfree<span style="color: #0000FF;">-<span style="color: #000000;">zcost<span style="color: #0000FF;">,<span style="color: #000000;">new_space<span style="color: #0000FF;">,<span style="color: #000000;">mdx<span style="color: #0000FF;">+<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #000000;">5<span style="color: #0000FF;">-<span style="color: #000000;">move<span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span>
<span style="color: #008080;">return</span> <span style="color: #004600;">true</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #000000;">board<span style="color: #0000FF;">[<span style="color: #000000;">new_space<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">piece</span>
<span style="color: #000000;">board<span style="color: #0000FF;">[<span style="color: #000000;">space<span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
<span style="color: #008080;">return</span> <span style="color: #004600;">false</span>
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
<span style="color: #7060A8;">pp<span style="color: #0000FF;">(<span style="color: #000000;">board<span style="color: #0000FF;">,<span style="color: #0000FF;">{<span style="color: #000000;">pp_IntFmt<span style="color: #0000FF;">,<span style="color: #008000;">"%2d"<span style="color: #0000FF;">,<span style="color: #000000;">pp_Maxlen<span style="color: #0000FF;">,<span style="color: #000000;">17<span style="color: #0000FF;">}<span style="color: #0000FF;">)</span>
<span style="color: #004080;">atom</span> <span style="color: #000000;">t0</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">n</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
<span style="color: #008080;">while</span> <span style="color: #008080;">not</span> <span style="color: #000000;">solve<span style="color: #0000FF;">(<span style="color: #000000;">n<span style="color: #0000FF;">,<span style="color: #000000;">space<span style="color: #0000FF;">)</span> <span style="color: #008080;">do</span> <span style="color: #000000;">n</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span> <span style="color: #008080;">end</span> <span style="color: #008080;">while</span>
<span style="color: #7060A8;">printf<span style="color: #0000FF;">(<span style="color: #000000;">1<span style="color: #0000FF;">,<span style="color: #008000;">"solution of %d moves found in %s: %s\n"<span style="color: #0000FF;">,</span>
<span style="color: #0000FF;">{<span style="color: #7060A8;">length<span style="color: #0000FF;">(<span style="color: #000000;">moves<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #7060A8;">elapsed<span style="color: #0000FF;">(<span style="color: #7060A8;">time<span style="color: #0000FF;">(<span style="color: #0000FF;">)<span style="color: #0000FF;">-<span style="color: #000000;">t0<span style="color: #0000FF;">)<span style="color: #0000FF;">,<span style="color: #000000;">moves<span style="color: #0000FF;">}<span style="color: #0000FF;">)
<!--</syntaxhighlight>-->
{{out}}
uppercase indicates the non-free moves (in manhattan cost terms).
<pre>
{15,14, 1, 6,
9,11, 4,12,
0,10, 7, 3,
13, 8, 5, 2}
solution of 52 moves found in 8.5s: RRruldluulDRurdddlUulurRrdLddrUldluurddlulurruldrrdd
</pre>
Extrapolating from 0.5s/4hrs of C++, as-is this would probably take at least 3 days to solve the extra credit...<br>
You could probably make solve() iterative rather than recursive, and then go all full-on-inline-assembly on it...
=={{header|PowerBASIC}}==
Works with PowerBASIC 6 Console Compiler
{{trans|Go}}
<syntaxhighlight lang="powerbasic">' The program solve fe169b4c0a73d852 in 4-5 seconds (on Intel Core i7-3770 3.40 GHz, 16 GB RAM, Windows 10 Pro).
' Test not completed with 0c9dfbae37254861 (still running after about 4 hours).
' Most of initialization is done in procedure fifteenSolver(), so it's possible to call it many times from the main function.
' No need to pass to fifteenSolver() the initial position of 0; the procedure determines it.
' Program includes procedure to create new configurations (by shuffling the correct final configuration).
' Program also includes a simple (text only) optional visualization of solving moves; the second (optional) parameter of fifteenSolver() is the pause between each move (in milliseconds).
'
' PowerBASIC compilers (both PBCC and PBWin) are 32 bits and are not that efficient when dealing with 64 bit integers (quad, only signed);
' this is not a problem for additions and subtractions, but left/right shift are quite slow;
' to speed up execution, left/right shift are done by inline X86 assembler (the PB statement is commented).
 
#compiler pbcc
#dim all
 
global Nr() as long
global Nc() as long
global n as long
global nn as long ' variable name _n not allowed
global N0() as long
global N3() as long
global N4() as long
global N2() as quad
 
%Ki=1
%Ke=2
%Kl=4
%Kg=8
 
%l=108 ' l
%r=114 ' r
%u=117 ' u
%d=100 ' d
 
function fY() as long
if N2(n) = &h123456789abcdef0 then
function=1
exit function
end if
if N4(n) <= nn then
function = fN()
exit function
end if
function = 0
end function
 
function fZ(byval w as long) as long
if (w and %Ki) > 0 then
call fI()
if fY() then
function = 1
exit function
end if
decr n
end if
if (w and %Kg) > 0 then
call fG()
if fY() then
function = 1
exit function
end if
decr n
end if
if (w and %Ke) > 0 then
call fE()
if fY() then
function = 1
exit function
end if
decr n
end if
if (w and %Kl) > 0 then
call fL()
if fY() then
function = 1
exit function
end if
decr n
end if
function = 0
end function
 
function fN() as long
select case N0(n)
case 0
select case N3(n)
case %l
function = fZ(%Ki)
exit function
case %u
function = fZ(%Ke)
exit function
case else
function = fZ(%Ki + %Ke)
exit function
end select
case 3
select case N3(n)
case %r
function = fZ(%Ki)
exit function
case %u
function = fZ(%Kl)
exit function
case else
function = fZ(%Ki + %Kl)
exit function
end select
case 1, 2
select case N3(n)
case %l
function = fZ(%Ki + %Kl)
exit function
case %r
function = fZ(%Ki + %Ke)
exit function
case %u
function = fZ(%Ke + %Kl)
exit function
case else
function = fZ(%Kl + %Ke + %Ki)
exit function
end select
case 12
select case N3(n)
case %l
function = fZ(%Kg)
exit function
case %d
function = fZ(%Ke)
exit function
case else
function = fZ(%Ke + %Kg)
exit function
end select
case 15
select case N3(n)
case %r
function = fZ(%Kg)
exit function
case %d
function = fZ(%Kl)
exit function
case else
function = fZ(%Kg + %Kl)
exit function
end select
case 13, 14
select case N3(n)
case %l
function = fZ(%Kg + %Kl)
exit function
case %r
function = fZ(%Ke + %Kg)
exit function
case %d
function = fZ(%Ke + %Kl)
exit function
case else
function = fZ(%Kg + %Ke + %Kl)
exit function
end select
case 4, 8
select case N3(n)
case %l
function = fZ(%Ki + %Kg)
exit function
case %u
function = fZ(%Kg + %Ke)
exit function
case %d
function = fZ(%Ki + %Ke)
exit function
case else
function = fZ(%Ki + %Kg + %Ke)
exit function
end select
case 7, 11
select case N3(n)
case %d
function = fZ(%Ki + %Kl)
exit function
case %u
function = fZ(%Kg + %Kl)
exit function
case %r
function = fZ(%Ki + %Kg)
exit function
case else
function = fZ(%Ki + %Kg + %Kl)
exit function
end select
case else
select case N3(n)
case %d
function = fZ(%Ki + %Ke + %Kl)
exit function
case %l
function = fZ(%Ki + %Kg + %Kl)
exit function
case %r
function = fZ(%Ki + %Kg + %Ke)
exit function
case %u
function = fZ(%Kg + %Ke + %Kl)
exit function
case else
function = fZ(%Ki + %Kg + %Ke + %Kl)
exit function
end select
end select
end function
 
sub fI()
local g as long
local a as quad
g = (11 - N0(n)) * 4
a = (N2(n) and lshift(15,g))
N0(n + 1) = N0(n) + 4
N2(n + 1) = N2(n) - a + lshift(a, 16)
N3(n + 1) = %d
N4(n + 1) = N4(n)
if isfalse(Nr(rshift(a,g)) <= N0(n)\4) then
incr N4(n + 1)
end if
incr n
end sub
 
sub fG()
local g as long
local a as quad
g = (19 - N0(n)) * 4
a = (N2(n) and lshift(15,g))
N0(n + 1) = N0(n) - 4
N2(n + 1) = N2(n) - a + rshift(a, 16)
N3(n + 1) = %u
N4(n + 1) = N4(n)
if isfalse(Nr(rshift(a,g)) >= N0(n)\4) then
incr N4(n + 1)
end if
incr n
end sub
 
sub fE()
local g as long
local a as quad
g = (14 - N0(n)) * 4
a = (N2(n) and lshift(15,g))
N0(n + 1) = N0(n) + 1
N2(n + 1) = N2(n) - a + lshift(a,4)
N3(n + 1) = %r
N4(n + 1) = N4(n)
if isfalse(Nc(rshift(a,g)) <= (N0(n) mod 4)) then
incr N4(n + 1)
end if
incr n
end sub
 
sub fL()
local g as long
local a as quad
g = (16 - N0(n)) * 4
a = (N2(n) and lshift(15,g))
N0(n + 1) = N0(n) - 1
N2(n + 1) = N2(n) - a + rshift(a,4)
N3(n + 1) = %l
N4(n + 1) = N4(n)
if isfalse(Nc(rshift(a,g)) >= (N0(n) mod 4)) then
incr N4(n + 1)
end if
incr n
end sub
 
function lshift(byval v as quad, byval s as dword) as quad
'shift left v, s
' inline assembler shift is much faster
!mov edx,v[4]
!mov eax,v
!mov ecx,s
!shld edx,eax,cl
!shl eax,cl
!test ecx,32
!jz skip
!mov edx,eax
!xor eax,eax
skip:
!mov v[4],edx
!mov v,eax
function = v
end function
 
function rshift(byval v as quad, byval s as dword) as quad
'shift right v, s
' inline assembler shift is much faster
!mov edx,v[4]
!mov eax,v
!mov ecx,s
!shrd eax,edx,cl
!shr edx,cl
!test ecx,32
!jz skip
!mov eax,edx
!xor edx,edx
skip:
!mov v[4],edx
!mov v,eax
function = v
end function
 
sub fifteenSolver(byval g as quad, optional byval p as long)
local h as string
local j as long
local s as string
local t as single
t=timer
redim Nr(0 to 15)
redim Nc(0 to 15)
redim N0(0 to 99)
redim N3(0 to 100)
redim N4(0 to 99)
redim N2(0 to 99)
array assign Nr()=3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3
array assign Nc()=3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2
n = 0
nn = 0
h = hex$(g, 16)
cls
print "Puzzle: ";lcase$(h)
call ShowConfiguration(h, 2)
print
print
N0(0) = instr(h, "0") - 1
N2(0) = g
call solve()
print using$("Solution found in #### moves: ", n);
for j = 1 to n
s = s + chr$(N3(j))
next
print s
print "Time = ";format$(timer-t, "#####.########");" seconds"
if p then
call showMoves(h, s, n, p)
end if
end sub
 
sub solve()
if fN() then
exit sub
else
n = 0
incr nn
call solve()
end if
end sub
 
function createPuzzle(byval j as long) as quad
local q as quad
local h as string
local z as long
local d as long
local r as long
local u as long
randomize timer
q=&h123456789abcdef0
h = hex$(q, 16)
u = 0
while j > 0 ' number of moves to do
do
d = rnd(1, 4) ' -1 +1 -4 +4
loop while d = u
u = -d
r = rnd(1, 3) ' repetitions
while r
z = instr(h, "0")
select case d
case 1 ' -1
if (z mod 4) <> 1 then
mid$(h, z, 1) = mid$(h, z - 1, 1)
mid$(h, z - 1, 1) = "0"
decr j
end if
case 2 ' +1
if (z mod 4) <> 0 then
mid$(h, z , 1) = mid$(h, z + 1, 1)
mid$(h, z + 1, 1) = "0"
decr j
end if
case 3 ' -4
if z >= 5 then
mid$(h, z, 1) = mid$(h, z - 4, 1)
mid$(h, z - 4, 1) = "0"
decr j
end if
case 4 ' +4
if z <= 12 then
mid$(h, z , 1) = mid$(h, z + 4, 1)
mid$(h, z + 4, 1) = "0"
decr j
end if
end select
decr r
wend
wend
function = val("&h"+h)
end function
 
sub shoWMoves(byval h as string, byval s as string, byval m as long, byval p as long)
local j as long
local z as long
local d as long
cursor off
call ShowConfiguration(h, 12)
for j = 1 to m
d = asc(mid$(s, j, 1))
z = instr(h, "0")
select case d
case %l
if (z mod 4) <> 1 then
mid$(h, z, 1) = mid$(h, z - 1, 1)
mid$(h, z - 1, 1) = "0"
end if
case %r
if (z mod 4) <> 0 then
mid$(h, z , 1) = mid$(h, z + 1, 1)
mid$(h, z + 1, 1) = "0"
end if
case %u
if z >= 5 then
mid$(h, z, 1) = mid$(h, z - 4, 1)
mid$(h, z - 4, 1) = "0"
end if
case %d
if z <= 12 then
mid$(h, z , 1) = mid$(h, z + 4, 1)
mid$(h, z + 4, 1) = "0"
end if
end select
call ShowConfiguration(h, 12)
sleep p
next
locate 20,1
print "Press any key ..."
cursor on
waitkey$
cls
end sub
 
sub ShowConfiguration(byval h as string, i as long)
local r as long
local c as long
local x as string
for r = 1 to 4
for c = 1 to 4
locate r + i, c + c - 1
x = mid$(h, r * 4 - 4 + c, 1)
if x = "0" then
x = " "
end if
print x;
next
next
end sub
 
function PBMain() as long
call fifteenSolver(&hfe169b4c0a73d852, 1000)
'call fifteenSolver(createPuzzle(100), 1000)
'call fifteenSolver(&h0c9dfbae37254861, 1000)
end function
</syntaxhighlight>
 
=={{header|Python}}==
===Iterative Depth A*===
From https://codegolf.stackexchange.com/questions/6884/solve-the-15-puzzle-the-tile-sliding-puzzle
 
Solution titled "PyPy, 195 moves, ~12 seconds computation"
 
Modified to run this task's 52 move problem.
 
<syntaxhighlight lang="python">
import random
 
 
class IDAStar:
def __init__(self, h, neighbours):
""" Iterative-deepening A* search.
 
h(n) is the heuristic that gives the cost between node n and the goal node. It must be admissable, meaning that h(n) MUST NEVER OVERSTIMATE the true cost. Underestimating is fine.
 
neighbours(n) is an iterable giving a pair (cost, node, descr) for each node neighbouring n
IN ASCENDING ORDER OF COST. descr is not used in the computation but can be used to
efficiently store information about the path edges (e.g. up/left/right/down for grids).
"""
 
self.h = h
self.neighbours = neighbours
self.FOUND = object()
 
 
def solve(self, root, is_goal, max_cost=None):
""" Returns the shortest path between the root and a given goal, as well as the total cost.
If the cost exceeds a given max_cost, the function returns None. If you do not give a
maximum cost the solver will never return for unsolvable instances."""
 
self.is_goal = is_goal
self.path = [root]
self.is_in_path = {root}
self.path_descrs = []
self.nodes_evaluated = 0
 
bound = self.h(root)
 
while True:
t = self._search(0, bound)
if t is self.FOUND: return self.path, self.path_descrs, bound, self.nodes_evaluated
if t is None: return None
bound = t
 
def _search(self, g, bound):
self.nodes_evaluated += 1
 
node = self.path[-1]
f = g + self.h(node)
if f > bound: return f
if self.is_goal(node): return self.FOUND
 
m = None # Lower bound on cost.
for cost, n, descr in self.neighbours(node):
if n in self.is_in_path: continue
 
self.path.append(n)
self.is_in_path.add(n)
self.path_descrs.append(descr)
t = self._search(g + cost, bound)
 
if t == self.FOUND: return self.FOUND
if m is None or (t is not None and t < m): m = t
 
self.path.pop()
self.path_descrs.pop()
self.is_in_path.remove(n)
 
return m
 
 
def slide_solved_state(n):
return tuple(i % (n*n) for i in range(1, n*n+1))
 
def slide_randomize(p, neighbours):
for _ in range(len(p) ** 2):
_, p, _ = random.choice(list(neighbours(p)))
return p
 
def slide_neighbours(n):
movelist = []
for gap in range(n*n):
x, y = gap % n, gap // n
moves = []
if x > 0: moves.append(-1) # Move the gap left.
if x < n-1: moves.append(+1) # Move the gap right.
if y > 0: moves.append(-n) # Move the gap up.
if y < n-1: moves.append(+n) # Move the gap down.
movelist.append(moves)
 
def neighbours(p):
gap = p.index(0)
l = list(p)
 
for m in movelist[gap]:
l[gap] = l[gap + m]
l[gap + m] = 0
yield (1, tuple(l), (l[gap], m))
l[gap + m] = l[gap]
l[gap] = 0
 
return neighbours
 
def slide_print(p):
n = int(round(len(p) ** 0.5))
l = len(str(n*n))
for i in range(0, len(p), n):
print(" ".join("{:>{}}".format(x, l) for x in p[i:i+n]))
 
def encode_cfg(cfg, n):
r = 0
b = n.bit_length()
for i in range(len(cfg)):
r |= cfg[i] << (b*i)
return r
 
 
def gen_wd_table(n):
goal = [[0] * i + [n] + [0] * (n - 1 - i) for i in range(n)]
goal[-1][-1] = n - 1
goal = tuple(sum(goal, []))
 
table = {}
to_visit = [(goal, 0, n-1)]
while to_visit:
cfg, cost, e = to_visit.pop(0)
enccfg = encode_cfg(cfg, n)
if enccfg in table: continue
table[enccfg] = cost
 
for d in [-1, 1]:
if 0 <= e + d < n:
for c in range(n):
if cfg[n*(e+d) + c] > 0:
ncfg = list(cfg)
ncfg[n*(e+d) + c] -= 1
ncfg[n*e + c] += 1
to_visit.append((tuple(ncfg), cost + 1, e+d))
 
return table
 
def slide_wd(n, goal):
wd = gen_wd_table(n)
goals = {i : goal.index(i) for i in goal}
b = n.bit_length()
 
def h(p):
ht = 0 # Walking distance between rows.
vt = 0 # Walking distance between columns.
d = 0
for i, c in enumerate(p):
if c == 0: continue
g = goals[c]
xi, yi = i % n, i // n
xg, yg = g % n, g // n
ht += 1 << (b*(n*yi+yg))
vt += 1 << (b*(n*xi+xg))
 
if yg == yi:
for k in range(i + 1, i - i%n + n): # Until end of row.
if p[k] and goals[p[k]] // n == yi and goals[p[k]] < g:
d += 2
 
if xg == xi:
for k in range(i + n, n * n, n): # Until end of column.
if p[k] and goals[p[k]] % n == xi and goals[p[k]] < g:
d += 2
 
d += wd[ht] + wd[vt]
 
return d
return h
 
 
 
 
if __name__ == "__main__":
solved_state = slide_solved_state(4)
neighbours = slide_neighbours(4)
is_goal = lambda p: p == solved_state
 
tests = [
(15, 14, 1, 6, 9, 11, 4, 12, 0, 10, 7, 3, 13, 8, 5, 2),
]
 
slide_solver = IDAStar(slide_wd(4, solved_state), neighbours)
 
for p in tests:
path, moves, cost, num_eval = slide_solver.solve(p, is_goal, 80)
slide_print(p)
print(", ".join({-1: "Left", 1: "Right", -4: "Up", 4: "Down"}[move[1]] for move in moves))
print(cost, num_eval)
</syntaxhighlight>
 
Output - this solution of the problem for this task is the same as the second solution:
 
rrruldluuldrurdddluulurrrdlddruldluurddlulurruldrrdd
 
Profiling with standard Python 3.7 took 30 seconds.
 
<pre>
15 14 1 6
9 11 4 12
0 10 7 3
13 8 5 2
Right, Right, Right, Up, Left, Down, Left, Up, Up, Left, Down, Right, Up, Right, Down, Down, Down, Left, Up, Up, Left, Up, Right, Right, Right, Down, Left, Down, Down, Right, Up, Left, Down, Left, Up, Up, Right, Down, Down, Left, Up, Left, Up, Right, Right, Up, Left, Down, Right, Right, Down, Down
52 872794
</pre>
 
===A* with good heuristic===
;File - astar.py
<syntaxhighlight lang="python">
"""
 
Python example for this Rosetta Code task:
 
http://rosettacode.org/wiki/15_puzzle_solver
 
Using A* Algorithm from Wikkipedia:
 
https://en.wikipedia.org/wiki/A*_search_algorithm
 
Need to use heuristic that guarantees a shortest path
solution.
 
"""
 
import heapq
import copy
 
# Hopefully this is larger than any fscore or gscore
 
integer_infinity = 1000000000
 
class Position(object):
"""Position class represents one position of a 15 puzzle"""
 
def __init__(self, tiles):
"""
Takes a tuple of tuples representing the tiles on a 4x4 puzzle board
numbering 1-15 with 0 representing an empty square. For example:
(( 1, 2, 3, 4),
( 5, 6, 7, 8),
( 9, 10, 11, 12),
(13, 14, 15, 0))
Converts list of lists representation into tuple of tuples.
"""
if type(tiles) == type(list()):
t = tiles
self.tiles = ((t[0][0], t[0][1], t[0][2], t[0][3]),
(t[1][0], t[1][1], t[1][2], t[1][3]),
(t[2][0], t[2][1], t[2][2], t[2][3]),
(t[3][0], t[3][1], t[3][2], t[3][3]))
else:
self.tiles = tiles
# fields for A* algorithm
self.fscore = integer_infinity
self.gscore = integer_infinity
self.cameFrom = None
def copy_tiles(self):
""" returns list of lists version """
t = self.tiles
return [[t[0][0], t[0][1], t[0][2], t[0][3]],
[t[1][0], t[1][1], t[1][2], t[1][3]],
[t[2][0], t[2][1], t[2][2], t[2][3]],
[t[3][0], t[3][1], t[3][2], t[3][3]]]
 
def neighbors(self):
"""
returns a list of neighbors
returns a list position objects with their
directiontomoveto set to the direction that the
empty square moved.
tiles is 4x4 tuple of tuples with
0,0 as top left.
tiles[y][x]
 
"""
# find 0 - blank square
x0 = None
y0 = None
for i in range(4):
for j in range(4):
if self.tiles[i][j] == 0:
y0 = i
x0 = j
 
if x0 == None or y0 == None:
return []
neighbor_list = []
# move 0 to the right
if x0 < 3:
new_tiles = self.copy_tiles()
temp = new_tiles[y0][x0+1]
new_tiles[y0][x0+1] = 0
new_tiles[y0][x0] = temp
new_pos = new_position(new_tiles)
neighbor_list.append(new_pos)
# move 0 to the left
if x0 > 0:
new_tiles = self.copy_tiles()
temp = new_tiles[y0][x0-1]
new_tiles[y0][x0-1] = 0
new_tiles[y0][x0] = temp
new_pos = new_position(new_tiles)
neighbor_list.append(new_pos)
# move 0 up
if y0 > 0:
new_tiles = self.copy_tiles()
temp = new_tiles[y0-1][x0]
new_tiles[y0-1][x0] = 0
new_tiles[y0][x0] = temp
new_pos = new_position(new_tiles)
neighbor_list.append(new_pos)
# move 0 down
if y0 < 3:
new_tiles = self.copy_tiles()
temp = new_tiles[y0+1][x0]
new_tiles[y0+1][x0] = 0
new_tiles[y0][x0] = temp
new_pos = new_position(new_tiles)
neighbor_list.append(new_pos)
return neighbor_list
def __repr__(self):
# printable version of self
return str(self.tiles[0])+'\n'+str(self.tiles[1])+'\n'+str(self.tiles[2])+'\n'+str(self.tiles[3])+'\n'
 
# takes tuple of tuples tiles as key, Position object for that tiles as value
 
all_positions = dict()
 
def new_position(tiles):
""" returns a new position or looks up existing one """
global all_positions
if type(tiles) == type(list()):
t = tiles
tuptiles = ((t[0][0], t[0][1], t[0][2], t[0][3]),
(t[1][0], t[1][1], t[1][2], t[1][3]),
(t[2][0], t[2][1], t[2][2], t[2][3]),
(t[3][0], t[3][1], t[3][2], t[3][3]))
else:
tuptiles = tiles
if tuptiles in all_positions:
return all_positions[tuptiles]
else:
new_pos = Position(tiles)
all_positions[tuptiles] = new_pos
return new_pos
def reconstruct_path(current):
"""
Uses the cameFrom members to follow the chain of moves backwards
and then reverses the list to get the path in the correct order.
"""
total_path = [current]
 
while current.cameFrom != None:
current = current.cameFrom
total_path.append(current)
total_path.reverse()
return total_path
class PriorityQueue(object):
"""
Priority queue using heapq.
elements of queue are (fscore,tiles) for each position.
If element is removed from queue and fscore doesn't match
then that element is discarded.
"""
 
def __init__(self, object_list):
"""
Save a list in a heapq.
Assume that each object only appears once
in the list.
"""
self.queue_length = 0
self.qheap = []
for e in object_list:
self.qheap.append((e.fscore,e.tiles))
self.queue_length += 1
heapq.heapify(self.qheap)
def push(self, new_object):
""" save object in heapq """
heapq.heappush(self.qheap,(new_object.fscore,new_object.tiles))
self.queue_length += 1
def pop(self):
""" remove object from heap and return """
if self.queue_length < 1:
return None
fscore, tiles = heapq.heappop(self.qheap)
self.queue_length -= 1
global all_positions
pos = all_positions[tiles]
if pos.fscore == fscore:
return pos
else:
return self.pop()
def __repr__(self):
# printable version of self
strrep = ""
for e in self.qheap:
fscore, tiles = e
strrep += str(fscore)+":"+str(tiles)+"\n"
return strrep
conflict_table = None
 
def build_conflict_table():
global conflict_table
conflict_table = dict()
# assumes goal tuple has up to
# for the given pattern it the start position
# how much to add for linear conflicts
# 2 per conflict - max of 6
# goal tuple is ('g0', 'g1', 'g2', 'g3')
conflict_table[('g0', 'g1', 'g2', 'g3')] = 0
conflict_table[('g0', 'g1', 'g2', 'x')] = 0
conflict_table[('g0', 'g1', 'g3', 'g2')] = 2
conflict_table[('g0', 'g1', 'g3', 'x')] = 0
conflict_table[('g0', 'g1', 'x', 'g2')] = 0
conflict_table[('g0', 'g1', 'x', 'g3')] = 0
conflict_table[('g0', 'g1', 'x', 'x')] = 0
conflict_table[('g0', 'g2', 'g1', 'g3')] = 2
conflict_table[('g0', 'g2', 'g1', 'x')] = 2
conflict_table[('g0', 'g2', 'g3', 'g1')] = 4
conflict_table[('g0', 'g2', 'g3', 'x')] = 0
conflict_table[('g0', 'g2', 'x', 'g1')] = 2
conflict_table[('g0', 'g2', 'x', 'g3')] = 0
conflict_table[('g0', 'g2', 'x', 'x')] = 0
conflict_table[('g0', 'g3', 'g1', 'g2')] = 4
conflict_table[('g0', 'g3', 'g1', 'x')] = 2
conflict_table[('g0', 'g3', 'g2', 'g1')] = 4
conflict_table[('g0', 'g3', 'g2', 'x')] = 2
conflict_table[('g0', 'g3', 'x', 'g1')] = 2
conflict_table[('g0', 'g3', 'x', 'g2')] = 2
conflict_table[('g0', 'g3', 'x', 'x')] = 0
conflict_table[('g0', 'x', 'g1', 'g2')] = 0
conflict_table[('g0', 'x', 'g1', 'g3')] = 0
conflict_table[('g0', 'x', 'g1', 'x')] = 0
conflict_table[('g0', 'x', 'g2', 'g1')] = 2
conflict_table[('g0', 'x', 'g2', 'g3')] = 0
conflict_table[('g0', 'x', 'g2', 'x')] = 0
conflict_table[('g0', 'x', 'g3', 'g1')] = 2
conflict_table[('g0', 'x', 'g3', 'g2')] = 2
conflict_table[('g0', 'x', 'g3', 'x')] = 0
conflict_table[('g0', 'x', 'x', 'g1')] = 0
conflict_table[('g0', 'x', 'x', 'g2')] = 0
conflict_table[('g0', 'x', 'x', 'g3')] = 0
conflict_table[('g1', 'g0', 'g2', 'g3')] = 2
conflict_table[('g1', 'g0', 'g2', 'x')] = 2
conflict_table[('g1', 'g0', 'g3', 'g2')] = 4
conflict_table[('g1', 'g0', 'g3', 'x')] = 2
conflict_table[('g1', 'g0', 'x', 'g2')] = 2
conflict_table[('g1', 'g0', 'x', 'g3')] = 2
conflict_table[('g1', 'g0', 'x', 'x')] = 2
conflict_table[('g1', 'g2', 'g0', 'g3')] = 4
conflict_table[('g1', 'g2', 'g0', 'x')] = 4
conflict_table[('g1', 'g2', 'g3', 'g0')] = 6
conflict_table[('g1', 'g2', 'g3', 'x')] = 0
conflict_table[('g1', 'g2', 'x', 'g0')] = 4
conflict_table[('g1', 'g2', 'x', 'g3')] = 0
conflict_table[('g1', 'g2', 'x', 'x')] = 0
conflict_table[('g1', 'g3', 'g0', 'g2')] = 4
conflict_table[('g1', 'g3', 'g0', 'x')] = 4
conflict_table[('g1', 'g3', 'g2', 'g0')] = 6
conflict_table[('g1', 'g3', 'g2', 'x')] = 0
conflict_table[('g1', 'g3', 'x', 'g0')] = 4
conflict_table[('g1', 'g3', 'x', 'g2')] = 2
conflict_table[('g1', 'g3', 'x', 'x')] = 0
conflict_table[('g1', 'x', 'g0', 'g2')] = 2
conflict_table[('g1', 'x', 'g0', 'g3')] = 2
conflict_table[('g1', 'x', 'g0', 'x')] = 2
conflict_table[('g1', 'x', 'g2', 'g0')] = 4
conflict_table[('g1', 'x', 'g2', 'g3')] = 0
conflict_table[('g1', 'x', 'g2', 'x')] = 0
conflict_table[('g1', 'x', 'g3', 'g0')] = 4
conflict_table[('g1', 'x', 'g3', 'g2')] = 2
conflict_table[('g1', 'x', 'g3', 'x')] = 0
conflict_table[('g1', 'x', 'x', 'g0')] = 2
conflict_table[('g1', 'x', 'x', 'g2')] = 0
conflict_table[('g1', 'x', 'x', 'g3')] = 0
conflict_table[('g2', 'g0', 'g1', 'g3')] = 4
conflict_table[('g2', 'g0', 'g1', 'x')] = 4
conflict_table[('g2', 'g0', 'g3', 'g1')] = 4
conflict_table[('g2', 'g0', 'g3', 'x')] = 2
conflict_table[('g2', 'g0', 'x', 'g1')] = 4
conflict_table[('g2', 'g0', 'x', 'g3')] = 2
conflict_table[('g2', 'g0', 'x', 'x')] = 2
conflict_table[('g2', 'g1', 'g0', 'g3')] = 4
conflict_table[('g2', 'g1', 'g0', 'x')] = 4
conflict_table[('g2', 'g1', 'g3', 'g0')] = 6
conflict_table[('g2', 'g1', 'g3', 'x')] = 2
conflict_table[('g2', 'g1', 'x', 'g0')] = 4
conflict_table[('g2', 'g1', 'x', 'g3')] = 2
conflict_table[('g2', 'g1', 'x', 'x')] = 2
conflict_table[('g2', 'g3', 'g0', 'g1')] = 4
conflict_table[('g2', 'g3', 'g0', 'x')] = 4
conflict_table[('g2', 'g3', 'g1', 'g0')] = 6
conflict_table[('g2', 'g3', 'g1', 'x')] = 4
conflict_table[('g2', 'g3', 'x', 'g0')] = 4
conflict_table[('g2', 'g3', 'x', 'g1')] = 4
conflict_table[('g2', 'g3', 'x', 'x')] = 0
conflict_table[('g2', 'x', 'g0', 'g1')] = 4
conflict_table[('g2', 'x', 'g0', 'g3')] = 2
conflict_table[('g2', 'x', 'g0', 'x')] = 2
conflict_table[('g2', 'x', 'g1', 'g0')] = 4
conflict_table[('g2', 'x', 'g1', 'g3')] = 2
conflict_table[('g2', 'x', 'g1', 'x')] = 2
conflict_table[('g2', 'x', 'g3', 'g0')] = 4
conflict_table[('g2', 'x', 'g3', 'g1')] = 4
conflict_table[('g2', 'x', 'g3', 'x')] = 0
conflict_table[('g2', 'x', 'x', 'g0')] = 2
conflict_table[('g2', 'x', 'x', 'g1')] = 2
conflict_table[('g2', 'x', 'x', 'g3')] = 0
conflict_table[('g3', 'g0', 'g1', 'g2')] = 6
conflict_table[('g3', 'g0', 'g1', 'x')] = 4
conflict_table[('g3', 'g0', 'g2', 'g1')] = 6
conflict_table[('g3', 'g0', 'g2', 'x')] = 4
conflict_table[('g3', 'g0', 'x', 'g1')] = 4
conflict_table[('g3', 'g0', 'x', 'g2')] = 4
conflict_table[('g3', 'g0', 'x', 'x')] = 2
conflict_table[('g3', 'g1', 'g0', 'g2')] = 6
conflict_table[('g3', 'g1', 'g0', 'x')] = 4
conflict_table[('g3', 'g1', 'g2', 'g0')] = 6
conflict_table[('g3', 'g1', 'g2', 'x')] = 4
conflict_table[('g3', 'g1', 'x', 'g0')] = 4
conflict_table[('g3', 'g1', 'x', 'g2')] = 4
conflict_table[('g3', 'g1', 'x', 'x')] = 2
conflict_table[('g3', 'g2', 'g0', 'g1')] = 6
conflict_table[('g3', 'g2', 'g0', 'x')] = 4
conflict_table[('g3', 'g2', 'g1', 'g0')] = 6
conflict_table[('g3', 'g2', 'g1', 'x')] = 4
conflict_table[('g3', 'g2', 'x', 'g0')] = 4
conflict_table[('g3', 'g2', 'x', 'g1')] = 4
conflict_table[('g3', 'g2', 'x', 'x')] = 2
conflict_table[('g3', 'x', 'g0', 'g1')] = 4
conflict_table[('g3', 'x', 'g0', 'g2')] = 4
conflict_table[('g3', 'x', 'g0', 'x')] = 2
conflict_table[('g3', 'x', 'g1', 'g0')] = 4
conflict_table[('g3', 'x', 'g1', 'g2')] = 4
conflict_table[('g3', 'x', 'g1', 'x')] = 2
conflict_table[('g3', 'x', 'g2', 'g0')] = 4
conflict_table[('g3', 'x', 'g2', 'g1')] = 4
conflict_table[('g3', 'x', 'g2', 'x')] = 2
conflict_table[('g3', 'x', 'x', 'g0')] = 2
conflict_table[('g3', 'x', 'x', 'g1')] = 2
conflict_table[('g3', 'x', 'x', 'g2')] = 2
conflict_table[('x', 'g0', 'g1', 'g2')] = 0
conflict_table[('x', 'g0', 'g1', 'g3')] = 0
conflict_table[('x', 'g0', 'g1', 'x')] = 0
conflict_table[('x', 'g0', 'g2', 'g1')] = 2
conflict_table[('x', 'g0', 'g2', 'g3')] = 0
conflict_table[('x', 'g0', 'g2', 'x')] = 0
conflict_table[('x', 'g0', 'g3', 'g1')] = 2
conflict_table[('x', 'g0', 'g3', 'g2')] = 2
conflict_table[('x', 'g0', 'g3', 'x')] = 0
conflict_table[('x', 'g0', 'x', 'g1')] = 0
conflict_table[('x', 'g0', 'x', 'g2')] = 0
conflict_table[('x', 'g0', 'x', 'g3')] = 0
conflict_table[('x', 'g1', 'g0', 'g2')] = 2
conflict_table[('x', 'g1', 'g0', 'g3')] = 2
conflict_table[('x', 'g1', 'g0', 'x')] = 2
conflict_table[('x', 'g1', 'g2', 'g0')] = 4
conflict_table[('x', 'g1', 'g2', 'g3')] = 0
conflict_table[('x', 'g1', 'g2', 'x')] = 0
conflict_table[('x', 'g1', 'g3', 'g0')] = 4
conflict_table[('x', 'g1', 'g3', 'g2')] = 2
conflict_table[('x', 'g1', 'g3', 'x')] = 0
conflict_table[('x', 'g1', 'x', 'g0')] = 2
conflict_table[('x', 'g1', 'x', 'g2')] = 0
conflict_table[('x', 'g1', 'x', 'g3')] = 0
conflict_table[('x', 'g2', 'g0', 'g1')] = 4
conflict_table[('x', 'g2', 'g0', 'g3')] = 2
conflict_table[('x', 'g2', 'g0', 'x')] = 2
conflict_table[('x', 'g2', 'g1', 'g0')] = 4
conflict_table[('x', 'g2', 'g1', 'g3')] = 2
conflict_table[('x', 'g2', 'g1', 'x')] = 2
conflict_table[('x', 'g2', 'g3', 'g0')] = 4
conflict_table[('x', 'g2', 'g3', 'g1')] = 4
conflict_table[('x', 'g2', 'g3', 'x')] = 0
conflict_table[('x', 'g2', 'x', 'g0')] = 2
conflict_table[('x', 'g2', 'x', 'g1')] = 2
conflict_table[('x', 'g2', 'x', 'g3')] = 0
conflict_table[('x', 'g3', 'g0', 'g1')] = 4
conflict_table[('x', 'g3', 'g0', 'g2')] = 4
conflict_table[('x', 'g3', 'g0', 'x')] = 2
conflict_table[('x', 'g3', 'g1', 'g0')] = 4
conflict_table[('x', 'g3', 'g1', 'g2')] = 4
conflict_table[('x', 'g3', 'g1', 'x')] = 2
conflict_table[('x', 'g3', 'g2', 'g0')] = 4
conflict_table[('x', 'g3', 'g2', 'g1')] = 4
conflict_table[('x', 'g3', 'g2', 'x')] = 2
conflict_table[('x', 'g3', 'x', 'g0')] = 2
conflict_table[('x', 'g3', 'x', 'g1')] = 2
conflict_table[('x', 'g3', 'x', 'g2')] = 2
conflict_table[('x', 'x', 'g0', 'g1')] = 0
conflict_table[('x', 'x', 'g0', 'g2')] = 0
conflict_table[('x', 'x', 'g0', 'g3')] = 0
conflict_table[('x', 'x', 'g1', 'g0')] = 2
conflict_table[('x', 'x', 'g1', 'g2')] = 0
conflict_table[('x', 'x', 'g1', 'g3')] = 0
conflict_table[('x', 'x', 'g2', 'g0')] = 2
conflict_table[('x', 'x', 'g2', 'g1')] = 2
conflict_table[('x', 'x', 'g2', 'g3')] = 0
conflict_table[('x', 'x', 'g3', 'g0')] = 2
conflict_table[('x', 'x', 'g3', 'g1')] = 2
conflict_table[('x', 'x', 'g3', 'g2')] = 2
def linear_conflicts(start_list,goal_list):
"""
calculates number of moves to add to the estimate of
the moves to get from start to goal based on the number
of conflicts on a given row or column. start_list
represents the current location and goal_list represnts
the final goal.
"""
# Find which of the tiles in start_list have their goals on this line
# build a pattern to use in a lookup table of this form:
# g0, g1, g3, g3 fill in x where there is no goal for this line
# all 'x' until we file a tile whose goal is in this line
goal_pattern = ['x', 'x', 'x', 'x']
for g in range(4):
for s in range(4):
start_tile_num = start_list[s]
if start_tile_num == goal_list[g] and start_tile_num != 0:
goal_pattern[s] = 'g' + str(g) # i.e. g0
global conflict_table
tup_goal_pattern = tuple(goal_pattern)
if tup_goal_pattern in conflict_table:
return conflict_table[tuple(goal_pattern)]
else:
return 0
class lcmap(dict):
"""
Lets you return 0 if you look for an object that
is not in the dictionary.
"""
def __missing__(self, key):
return 0
 
def listconflicts(goal_list):
"""
list all possible start lists that will have at least
one linear conflict.
Possible goal tile configurations
g g g g
g g g x
g g x g
g x g g
x g g g
g g x x
g x g x
g x x g
x g g x
x g x g
x x g g
"""
all_tiles = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
non_goal_tiles = []
for t in all_tiles:
if t not in goal_list:
non_goal_tiles.append(t)
combinations = lcmap()
 
# g g g g
for i in goal_list:
tile_list2 = goal_list[:]
tile_list2.remove(i)
for j in tile_list2:
tile_list3 = tile_list2[:]
tile_list3.remove(j)
for k in tile_list3:
tile_list4 = tile_list3[:]
tile_list4.remove(k)
for l in tile_list4:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
# g g g x
for i in goal_list:
tile_list2 = goal_list[:]
tile_list2.remove(i)
for j in tile_list2:
tile_list3 = tile_list2[:]
tile_list3.remove(j)
for k in tile_list3:
for l in non_goal_tiles:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
 
# g g x g
for i in goal_list:
tile_list2 = goal_list[:]
tile_list2.remove(i)
for j in tile_list2:
tile_list3 = tile_list2[:]
tile_list3.remove(j)
for k in non_goal_tiles:
for l in tile_list3:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
# g x g g
for i in goal_list:
tile_list2 = goal_list[:]
tile_list2.remove(i)
for j in non_goal_tiles:
for k in tile_list2:
tile_list3 = tile_list2[:]
tile_list3.remove(k)
for l in tile_list3:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
 
# x g g g
for i in non_goal_tiles:
for j in goal_list:
tile_list2 = goal_list[:]
tile_list2.remove(j)
for k in tile_list2:
tile_list3 = tile_list2[:]
tile_list3.remove(k)
for l in tile_list3:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
 
# g g x x
 
for i in goal_list:
tile_list2 = goal_list[:]
tile_list2.remove(i)
for j in tile_list2:
tile_list3 = tile_list2[:]
tile_list3.remove(j)
for k in non_goal_tiles:
tile_list4 = non_goal_tiles[:]
tile_list4.remove(k)
for l in tile_list4:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
# g x g x
 
for i in goal_list:
tile_list2 = goal_list[:]
tile_list2.remove(i)
for j in non_goal_tiles:
tile_list3 = non_goal_tiles[:]
tile_list3.remove(j)
for k in tile_list2:
for l in tile_list3:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
# g x x g
 
for i in goal_list:
tile_list2 = goal_list[:]
tile_list2.remove(i)
for j in non_goal_tiles:
tile_list3 = non_goal_tiles[:]
tile_list3.remove(j)
for k in tile_list2:
for l in tile_list3:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
# x g g x
 
for i in non_goal_tiles:
tile_list2 = non_goal_tiles[:]
tile_list2.remove(i)
for j in goal_list:
tile_list3 = goal_list[:]
tile_list3.remove(j)
for k in tile_list3:
for l in tile_list2:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
# x g x g
for i in non_goal_tiles:
tile_list2 = non_goal_tiles[:]
tile_list2.remove(i)
for j in goal_list:
tile_list3 = goal_list[:]
tile_list3.remove(j)
for k in tile_list3:
for l in tile_list2:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
# x x g g
for i in non_goal_tiles:
tile_list2 = non_goal_tiles[:]
tile_list2.remove(i)
for j in tile_list2:
for k in goal_list:
tile_list3 = goal_list[:]
tile_list3.remove(k)
for l in tile_list3:
start_list = (i, j, k, l)
conflictadd = linear_conflicts(start_list,goal_list)
if conflictadd > 0:
combinations[start_list]=conflictadd
return combinations
 
 
class HeuristicObj(object):
""" Object used to preprocess goal position for heuristic function """
 
def __init__(self, goal):
"""
Preprocess goal position to setup internal data structures
that can be used to speed up heuristic.
"""
build_conflict_table()
self.goal_map = []
for i in range(16):
self.goal_map.append(i)
self.goal_lists = goal.tiles
# preprocess for manhattan distance
for row in range(4):
for col in range(4):
self.goal_map[goal.tiles[row][col]] = (row, col)
# make access faster by changing to a tuple
self.goal_map = tuple(self.goal_map)
# preprocess for linear conflicts
self.row_conflicts = []
for row in range(4):
t = goal.tiles[row]
conf_dict = listconflicts([t[0],t[1],t[2],t[3]])
self.row_conflicts.append(conf_dict)
self.col_conflicts = []
for col in range(4):
col_list =[]
for row in range(4):
col_list.append(goal.tiles[row][col])
conf_dict = listconflicts(col_list)
self.col_conflicts.append(conf_dict)
 
def heuristic(self, start):
"""
Estimates the number of moves from start to goal.
The goal was preprocessed in __init__.
"""
distance = 0
# local variables for instance variables
t = start.tiles
g = self.goal_map
rc = self.row_conflicts
cc = self.col_conflicts
# calculate manhattan distance
for row in range(4):
for col in range(4):
start_tilenum = t[row][col]
if start_tilenum != 0:
(grow, gcol) = g[start_tilenum]
distance += abs(row - grow) + abs(col - gcol)
# add linear conflicts
for row in range(4):
curr_row = t[row]
distance += rc[row][curr_row]
for col in range(4):
col_tuple = (t[0][col], t[1][col], t[2][col], t[3][col])
distance += cc[col][col_tuple]
return distance
# global variable for heuristic object
 
hob = None
def a_star(start_tiles, goal_tiles):
""" Based on https://en.wikipedia.org/wiki/A*_search_algorithm """
start = new_position(start_tiles)
goal = new_position(goal_tiles)
# Process goal position for use in heuristic
global hob
hob = HeuristicObj(goal)
# The set of currently discovered nodes that are not evaluated yet.
# Initially, only the start node is known.
# For the first node, the fscore is completely heuristic.
start.fscore = hob.heuristic(start)
openSet = PriorityQueue([start])
# The cost of going from start to start is zero.
start.gscore = 0
num_popped = 0
while openSet.queue_length > 0:
current = openSet.pop()
if current == None: # tried to pop but only found old fscore values
break
num_popped += 1
if num_popped % 100000 == 0:
print(str(num_popped)+" positions examined")
if current == goal:
return reconstruct_path(current)
for neighbor in current.neighbors():
 
# The distance from start to a neighbor
# All nodes are 1 move from their neighbors
tentative_gScore = current.gscore + 1
# update gscore and fscore if this is shorter path
# to the neighbor node
 
if tentative_gScore < neighbor.gscore:
neighbor.cameFrom = current
neighbor.gscore = tentative_gScore
neighbor.fscore = neighbor.gscore + hob.heuristic(neighbor)
openSet.push(neighbor) # add to open set every time
 
def find_zero(tiles):
""" file the 0 tile """
for row in range(4):
for col in range(4):
if tiles[row][col] == 0:
return (row, col)
 
def path_as_0_moves(path):
"""
Takes the path which is a list of Position
objects and outputs it as a string of rlud
directions to match output desired by
Rosetta Code task.
"""
strpath = ""
if len(path) < 1:
return ""
prev_pos = path[0]
p_row, p_col = find_zero(prev_pos.tiles)
for i in range(1,len(path)):
curr_pos = path[i]
c_row, c_col = find_zero(curr_pos.tiles)
if c_row > p_row:
strpath += 'd'
elif c_row < p_row:
strpath += 'u'
elif c_col > p_col:
strpath += 'r'
elif c_col < p_col:
strpath += 'l'
# reset for next loop
prev_pos = curr_pos
p_row = c_row
p_col = c_col
return strpath
</syntaxhighlight>
 
;File - testone.py
 
<syntaxhighlight lang="python">
"""
 
Runs one test of the solver passing a
start and goal position.
 
"""
 
from astar import *
import time
 
# Rosetta Code start position
 
 
start_tiles = [[ 15, 14, 1, 6],
[ 9, 11, 4, 12],
[ 0, 10, 7, 3],
[13, 8, 5, 2]]
 
goal_tiles = [[ 1, 2, 3, 4],
[ 5, 6, 7, 8],
[ 9, 10, 11, 12],
[13, 14, 15, 0]]
 
before = time.perf_counter()
 
result = a_star(start_tiles,goal_tiles)
 
after = time.perf_counter()
 
print(" ")
print("Path length = "+str(len(result) - 1))
print(" ")
print("Path using rlud:")
print(" ")
print(path_as_0_moves(result))
print(" ")
print("Run time in seconds: "+str(after - before))
</syntaxhighlight>
Output:
 
<pre>
C:\bobby\15puzzlesolver\my15puzzlesolver>testone.py
100000 positions examined
200000 positions examined
300000 positions examined
400000 positions examined
500000 positions examined
600000 positions examined
700000 positions examined
800000 positions examined
 
Path length = 52
 
Path using rlud:
 
rrruldluuldrurdddluulurrrdlddruldluurddlulurruldrrdd
 
Run time in seconds: 56.601139201
</pre>
=={{header|Racket}}==
<syntaxhighlight lang="racket">
#lang racket
 
;;; Solution to the 15-puzzle game, based on the A* algorithm described
;;; at https://de.wikipedia.org/wiki/A*-Algorithmus
 
;;; Inspired by the Python solution of the rosetta code:
;;; http://rosettacode.org/wiki/15_puzzle_solver#Python
 
(require racket/set)
(require data/heap)
 
;; ----------------------------------------------------------------------------
;; Datatypes
 
;; A posn is a pair struct containing two integer for the row/col indices.
(struct posn (row col) #:transparent)
 
;; A state contains a vector and a posn describing the position of the empty slot.
(struct state (matrix empty-slot) #:transparent)
 
(define directions '(up down left right))
 
;; A node contains a state, a reference to the previous node, a g value (actual
;; costs until this node, and a f value (g value + heuristics).
(struct node (state prev cost f-value) #:transparent)
 
;; ----------------------------------------------------------------------------
;; Constants
 
(define side-size 4)
 
(define initial-state
(state
#(
15 14 1 6
9 11 4 12
0 10 7 3
13 8 5 2)
(posn 2 0)))
 
 
(define goal-state
(state
#( 1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 0)
(posn 3 3)))
 
;; ----------------------------------------------------------------------------
;; Functions
 
;; Matrices are simple vectors, abstracted by following functions.
(define (matrix-ref matrix row col)
(vector-ref matrix (+ (* row side-size) col)))
 
(define (matrix-set! matrix row col val)
(vector-set! matrix
(+ (* row side-size) col)
val))
 
(define (target-state? st)
(equal? st goal-state))
 
;; Traverse all nodes until the initial state and generate a return a list
;; of symbols describing the path.
(define (reconstruct-movements leaf-node)
;; compute a pair describing the movement.
(define (posn-diff p0 p1)
(posn (- (posn-row p1) (posn-row p0))
(- (posn-col p1) (posn-col p0))))
;; describe a single movement with a symbol (r, l, u d).
(define (find-out-movement prev-st st)
(let ([prev-empty-slot (state-empty-slot prev-st)]
[this-empty-slot (state-empty-slot st)])
(match (posn-diff prev-empty-slot this-empty-slot)
[(posn 1 0) 'u]
[(posn -1 0) 'd]
[(posn 0 1) 'l]
[(posn 0 -1) 'r]
[#f 'invalid])))
(define (iter n path)
(if (or (not n) (not (node-prev n)))
path
(iter (node-prev n)
(cons (find-out-movement (node-state n)
(node-state (node-prev n)))
path))))
(iter leaf-node '()))
 
(define (print-path path)
(for ([dir (in-list (car path))])
(display dir))
(newline))
 
;; Return #t if direction is allowed for the given empty slot position.
(define (movement-valid? direction empty-slot)
(match direction
['up (< (posn-row empty-slot) (- side-size 1))]
['down (> (posn-row empty-slot) 0)]
['left (< (posn-col empty-slot) (- side-size 1))]
['right (> (posn-col empty-slot) 0)]))
 
;; assumes move direction is valid (see movement-valid?).
;; Return a new state in the given direction.
(define (move st direction)
(define m (vector-copy (state-matrix st)))
(define empty-slot (state-empty-slot st))
(define r (posn-row empty-slot))
(define c (posn-col empty-slot))
(define new-empty-slot
(match direction
['up (begin (matrix-set! m r c (matrix-ref m (+ r 1) c))
(matrix-set! m (+ r 1) c 0)
(posn (+ r 1) c))]
['down (begin (matrix-set! m r c (matrix-ref m (- r 1) c))
(matrix-set! m (- r 1) c 0)
(posn (- r 1) c))]
['left (begin (matrix-set! m r c (matrix-ref m r (+ c 1)))
(matrix-set! m r (+ c 1) 0)
(posn r (+ c 1)))]
['right (begin (matrix-set! m r c (matrix-ref m r (- c 1)))
(matrix-set! m r (- c 1) 0)
(posn r (- c 1)))]))
(state m new-empty-slot))
 
(define (l1-distance posn0 posn1)
(+ (abs (- (posn-row posn0) (posn-row posn1)))
(abs (- (posn-col posn0) (posn-col posn1)))))
 
;; compute the L1 distance from the current position and the goal position for
;; the given val
(define (element-cost val current-posn)
(if (= val 0)
(l1-distance current-posn (posn 3 3))
(let ([target-row (quotient (- val 1) side-size)]
[target-col (remainder (- val 1) side-size)])
(l1-distance current-posn (posn target-row target-col)))))
 
;; compute the l1 distance between this state and the goal-state
(define (state-l1-distance-to-goal st)
(define m (state-matrix st))
(for*/fold
([sum 0])
([i (in-range side-size)]
[j (in-range side-size)])
(let ([val (matrix-ref m i j)])
(if (not (= val 0))
(+ sum (element-cost val (posn i j)))
sum))))
 
;; the heuristic used is the l1 distance to the goal-state + the number of
;; linear conflicts found
(define (state-heuristics st)
(+ (state-l1-distance-to-goal st)
(linear-conflicts st goal-state)))
 
;; given a list, return the number of values out of order (used for computing
;; linear conflicts).
(define (out-of-order-values lst)
(define (iter val-lst sum)
(if (empty? val-lst)
sum
(let* ([val (car val-lst)]
[rst (cdr val-lst)]
[following-smaller-values
(filter (lambda (val2) (> val2 val))
rst)])
(iter rst (+ sum (length following-smaller-values))))))
(* 2 (iter lst 0)))
 
;; Number of conflicts in the given row. A conflict happens, when two elements
;; are already in the correct row, but in the wrong order.
;; For each conflicted pair add 2 to the value, but a maximum of 6.
(define (row-conflicts row st0 st1)
(define m0 (state-matrix st0))
(define m1 (state-matrix st1))
(define values-in-correct-row
(for/fold
([lst '()])
([col0 (in-range side-size)])
(let* ([val0 (matrix-ref m0 row col0)]
[in-goal-row?
(for/first ([col1 (in-range side-size)]
#:when (= val0 (matrix-ref m1 row col1)))
#t)])
(if in-goal-row? (cons val0 lst) lst))))
(min 6 (out-of-order-values
; 0 doesn't lead to a linear conflict
(filter positive? values-in-correct-row))))
 
;; Number of conflicts in the given row. A conflict happens, when two elements
;; are already in the correct column but in the wrong order.
;; For each conflicted pair add 2 to the value, but a maximum of 6, so that
;; the heuristic doesn't overestimate the actual costs.
(define (col-conflicts col st0 st1)
(define m0 (state-matrix st0))
(define m1 (state-matrix st1))
(define values-in-correct-col
(for/fold
([lst '()])
([row0 (in-range side-size)])
(let* ([val0 (matrix-ref m0 row0 col)]
[in-goal-col?
(for/first ([row1 (in-range side-size)]
#:when (= val0 (matrix-ref m1 row1 col)))
#t)])
(if in-goal-col? (cons val0 lst) lst))))
(min 6 (out-of-order-values
; 0 doesn't lead to a linear conflict
(filter positive? values-in-correct-col))))
 
(define (all-row-conflicts st0 st1)
(for/fold ([sum 0])
([row (in-range side-size)])
(+ (row-conflicts row st0 st1) sum)))
 
(define (all-col-conflicts st0 st1)
(for/fold ([sum 0])
([col (in-range side-size)])
(+ (col-conflicts col st0 st1) sum)))
 
(define (linear-conflicts st0 st1)
(+ (all-row-conflicts st0 st1) (all-col-conflicts st0 st1)))
 
;; Return a list of pairs containing the possible next node and the movement
;; direction needed.
(define (next-state-dir-pairs current-node)
(define st (node-state current-node))
(define empty-slot (state-empty-slot st))
(define valid-movements
(filter (lambda (dir) (movement-valid? dir empty-slot))
directions))
(map (lambda (dir)
(cons (move st dir) dir))
valid-movements))
 
;; Helper function to pretty-print a state
(define (display-state st)
(define m (state-matrix st))
(begin
(for ([i (in-range 0 side-size 1)])
(newline)
(for ([j (in-range 0 side-size 1)])
(printf "~a\t" (matrix-ref m i j))))
(newline)))
 
 
(define (A* initial-st)
(define (compare-nodes n0 n1)
(<= (node-f-value n0) (node-f-value n1)))
(define open-lst (make-heap compare-nodes))
(define initial-st-cost (state-heuristics initial-st))
(heap-add! open-lst (node initial-st #f 0 (state-heuristics initial-st)))
(define closed-set (mutable-set))
(define (pick-next-node!)
(define next-node (heap-min open-lst))
(heap-remove-min! open-lst)
next-node)
(define (sort-lst lst)
(sort lst
(lambda (n0 n1)
(< (node-f-value n0) (node-f-value n1)))))
(define (expand-node n)
(define n-cost (node-cost n))
(define (iter lst)
(if (empty? lst)
'()
(let* ([succ (car lst)]
[succ-st (car succ)]
[succ-dir (cdr succ)]
[succ-cost (+ 1 n-cost)])
(if (set-member? closed-set succ-st)
(iter (cdr lst))
(begin (heap-add! open-lst
(node succ-st
n
succ-cost
(+ (state-heuristics succ-st)
succ-cost)))
(iter (cdr lst)))))))
(let ([successors (next-state-dir-pairs n)])
(iter successors)))
(define counter 0)
(define (loop)
(define current-node (pick-next-node!))
(define current-state (node-state current-node))
(set! counter (+ counter 1))
(if (= (remainder counter 100000) 0)
(printf "~a ~a ~a\n" counter
(heap-count open-lst)
(node-cost current-node))
(void))
(cond [(target-state? current-state)
(let ([path (reconstruct-movements current-node)])
(cons path (length path)))]
[else
(begin (set-add! closed-set (node-state current-node))
(expand-node current-node)
(if (= (heap-count open-lst) 0)
#f
(loop)))]))
(loop))
 
(module+ main
(print-path (A* initial-state)))
</syntaxhighlight>
 
=={{header|Raku}}==
{{trans|C++}}
<syntaxhighlight lang="raku" line># 20210623 Raku programming solution vCSMt9hkak0
 
constant \Nr = <3 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3>;
constant \Nc = <3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2>;
 
my ($n,$m) = 0,0 ;
my @N0 is default(0);
my @N3 is default(0);
my @N4 is default(0);
my @N2 is default(0);
 
sub fY() {
if @N2[$n] == 0x123456789abcdef0 {
say "Solution found in ", $n, " moves: ", [~] @N3[1..$n] and exit();
}
return @N4[$n] ≤ $m ?? fN() !! False ;
}
 
sub fN() {
sub common { ++$n; return True if fY(); --$n }
if (@N3[$n] ne 'u' && @N0[$n] div 4 < 3) { fI() and common }
if (@N3[$n] ne 'd' && @N0[$n] div 4 > 0) { fG() and common }
if (@N3[$n] ne 'l' && @N0[$n] % 4 < 3) { fE() and common }
if (@N3[$n] ne 'r' && @N0[$n] % 4 > 0) { fL() and common }
return False;
}
 
sub fI() {
my \g = (11-@N0[$n])*4;
my \a = @N2[$n] +& (15 +< g);
@N0[$n+1]=@N0[$n]+4;
@N2[$n+1]=@N2[$n]-a+(a+<16);
@N3[$n+1]='d';
@N4[$n+1]=@N4[$n]+(Nr[a+>g] ≤ @N0[$n] div 4 ?? 0 !! 1);
}
 
sub fG() {
my \g = (19-@N0[$n])*4;
my \a = @N2[$n] +& (15 +< g);
@N0[$n+1]=@N0[$n]-4;
@N2[$n+1]=@N2[$n]-a+(a+>16);
@N3[$n+1]='u';
@N4[$n+1]=@N4[$n]+(Nr[a+>g] ≥ @N0[$n] div 4 ?? 0 !! 1);
}
 
sub fE() {
my \g = (14-@N0[$n])*4;
my \a = @N2[$n] +& (15 +< g);
@N0[$n+1]=@N0[$n]+1;
@N2[$n+1]=@N2[$n]-a+(a+<4);
@N3[$n+1]='r';
@N4[$n+1]=@N4[$n]+(Nc[a+>g] ≤ @N0[$n]%4 ?? 0 !! 1);
}
 
sub fL(){
my \g = (16-@N0[$n])*4;
my \a = @N2[$n] +& (15 +< g);
@N0[$n+1]=@N0[$n]-1;
@N2[$n+1]=@N2[$n]-a+(a+>4);
@N3[$n+1]='l';
@N4[$n+1]=@N4[$n]+(Nc[a+>g] ≥ @N0[$n]%4 ?? 0 !! 1);
}
 
sub fifteenSolver(\n, \g){@N0[0]=n; @N2[0]=g}
 
 
fifteenSolver(8,0xfe169b4c0a73d852);
loop { fY() or ++$m }
</syntaxhighlight>
{{out}}
<pre>
Solution found in 52 moves: rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd
</pre>
 
=={{header|Rust}}==
{{trans|C++}}
<syntaxhighlight lang="rust">const NR: [i32; 16] = [3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3];
const NC: [i32; 16] = [3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2];
 
const I: u8 = 1;
const G: u8 = 8;
const E: u8 = 2;
const L: u8 = 4;
 
struct FifteenSolver {
n: usize,
limit: usize,
n0: [i32; 85],
n3: [u8; 85],
n4: [usize; 85],
n2: [u64; 85],
}
 
impl FifteenSolver {
fn f_y(&mut self) -> bool {
if self.n2[self.n] == 0x123456789abcdef0 {
return true;
}
if self.n4[self.n] <= self.limit {
return self.f_n();
}
false
}
 
fn f_z(&mut self, w: u8) -> bool {
if w & I != 0 {
self.f_i();
if self.f_y() {
return true;
}
self.n -= 1;
}
if w & G != 0 {
self.f_g();
if self.f_y() {
return true;
}
self.n -= 1;
}
if w & E != 0 {
self.f_e();
if self.f_y() {
return true;
}
self.n -= 1;
}
if w & L != 0 {
self.f_l();
if self.f_y() {
return true;
}
self.n -= 1;
}
false
}
 
fn f_n(&mut self) -> bool {
self.f_z(match self.n0[self.n] {
0 => match self.n3[self.n] {
b'l' => I,
b'u' => E,
_ => I + E,
},
3 => match self.n3[self.n] {
b'r' => I,
b'u' => L,
_ => I + L,
},
1 | 2 => match self.n3[self.n] {
b'l' => I + L,
b'r' => I + E,
b'u' => E + L,
_ => L + E + I,
},
12 => match self.n3[self.n] {
b'l' => G,
b'd' => E,
_ => E + G,
},
15 => match self.n3[self.n] {
b'r' => G,
b'd' => L,
_ => G + L,
},
13 | 14 => match self.n3[self.n] {
b'l' => G + L,
b'r' => E + G,
b'd' => E + L,
_ => G + E + L,
},
4 | 8 => match self.n3[self.n] {
b'l' => I + G,
b'u' => G + E,
b'd' => I + E,
_ => I + G + E,
},
7 | 11 => match self.n3[self.n] {
b'd' => I + L,
b'u' => G + L,
b'r' => I + G,
_ => I + G + L,
},
_ => match self.n3[self.n] {
b'd' => I + E + L,
b'l' => I + G + L,
b'r' => I + G + E,
b'u' => G + E + L,
_ => I + G + E + L,
},
})
}
 
fn f_i(&mut self) {
let g = (11 - self.n0[self.n]) * 4;
let a = self.n2[self.n] & (15u64 << g);
self.n0[self.n + 1] = self.n0[self.n] + 4;
self.n2[self.n + 1] = self.n2[self.n] - a + (a << 16);
self.n3[self.n + 1] = b'd';
self.n4[self.n + 1] = self.n4[self.n];
let cond = NR[(a >> g) as usize] <= self.n0[self.n] / 4;
if !cond {
self.n4[self.n + 1] += 1;;
}
self.n += 1;
}
 
fn f_g(&mut self) {
let g = (19 - self.n0[self.n]) * 4;
let a = self.n2[self.n] & (15u64 << g);
self.n0[self.n + 1] = self.n0[self.n] - 4;
self.n2[self.n + 1] = self.n2[self.n] - a + (a >> 16);
self.n3[self.n + 1] = b'u';
self.n4[self.n + 1] = self.n4[self.n];
let cond = NR[(a >> g) as usize] >= self.n0[self.n] / 4;
if !cond {
self.n4[self.n + 1] += 1;
}
self.n += 1;
}
 
fn f_e(&mut self) {
let g = (14 - self.n0[self.n]) * 4;
let a = self.n2[self.n] & (15u64 << g);
self.n0[self.n + 1] = self.n0[self.n] + 1;
self.n2[self.n + 1] = self.n2[self.n] - a + (a << 4);
self.n3[self.n + 1] = b'r';
self.n4[self.n + 1] = self.n4[self.n];
let cond = NC[(a >> g) as usize] <= self.n0[self.n] % 4;
if !cond {
self.n4[self.n + 1] += 1;
}
self.n += 1;
}
 
fn f_l(&mut self) {
let g = (16 - self.n0[self.n]) * 4;
let a = self.n2[self.n] & (15u64 << g);
self.n0[self.n + 1] = self.n0[self.n] - 1;
self.n2[self.n + 1] = self.n2[self.n] - a + (a >> 4);
self.n3[self.n + 1] = b'l';
self.n4[self.n + 1] = self.n4[self.n];
let cond = NC[(a >> g) as usize] >= self.n0[self.n] % 4;
if !cond {
self.n4[self.n + 1] += 1;
}
self.n += 1;
}
 
fn new(n: i32, g: u64) -> Self {
let mut solver = FifteenSolver {
n: 0,
limit: 0,
n0: [0; 85],
n3: [0; 85],
n4: [0; 85],
n2: [0; 85],
};
solver.n0[0] = n;
solver.n2[0] = g;
solver
}
 
fn solve(&mut self) {
while !self.f_n() {
self.n = 0;
self.limit += 1;
}
println!(
"Solution found in {} moves: {}",
self.n,
std::str::from_utf8(&self.n3[1..=self.n]).unwrap()
);
}
}
 
fn main() {
FifteenSolver::new(8, 0xfe169b4c0a73d852).solve();
}</syntaxhighlight>
 
{{out}}
<pre>Solution found in 52 moves: rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd</pre>
 
=== alternative ===
<syntaxhighlight lang="rust">use keyed_priority_queue::KeyedPriorityQueue;
use std::cmp::{Ord, Ordering, PartialOrd, Reverse};
 
static CORRECT_ORDER: [u8; 16] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0];
static ROW: [i32; 16] = [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3];
static COLUMN: [i32; 16] = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3];
 
#[derive(Debug, Clone)]
struct State {
est_tot_moves: u8,
moves: String,
est_moves_rem: u8,
}
 
impl PartialOrd for State {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.est_tot_moves.cmp(&other.est_tot_moves))
}
}
 
impl Eq for State {}
 
impl PartialEq for State {
fn eq(&self, other: &Self) -> bool {
self.est_tot_moves.cmp(&other.est_tot_moves) == Ordering::Equal
}
}
 
impl Ord for State {
fn cmp(&self, other: &Self) -> Ordering {
self.est_tot_moves
.partial_cmp(&other.est_tot_moves)
.unwrap()
}
}
 
impl State {
fn init(order: &[u8; 16]) -> State {
State {
est_tot_moves: State::estimate_moves(&order),
moves: String::from(""),
est_moves_rem: 0,
}
}
 
fn find_index(order: &[u8; 16], tile: &u8) -> usize {
order.iter().position(|&x| x == *tile).unwrap()
}
 
fn estimate_moves(current: &[u8; 16]) -> u8 {
let mut h = 0;
for tile in current.iter() {
let current_index = State::find_index(current, &tile);
let correct_index = State::find_index(&CORRECT_ORDER, &tile);
h += ((COLUMN[current_index] - COLUMN[correct_index]).abs()
+ (ROW[current_index] - ROW[correct_index]).abs()) as u8;
}
h
}
 
fn make_move(
&self,
order: &[u8; 16],
dir: fn(usize, [u8; 16]) -> ([u8; 16], String),
) -> ([u8; 16], State) {
let est_moves_rem = State::estimate_moves(order);
let (new_order, from) = dir(State::find_index(order, &0), *order);
let moves = format!("{}{}", self.moves, from);
let new_state = State {
est_tot_moves: moves.len() as u8 + est_moves_rem,
moves,
est_moves_rem,
};
return (new_order, new_state);
}
 
fn left(index: usize, mut order: [u8; 16]) -> ([u8; 16], String) {
order.swap(index, index - 1);
return (order, String::from("l"));
}
 
fn right(index: usize, mut order: [u8; 16]) -> ([u8; 16], String) {
order.swap(index, index + 1);
return (order, String::from("r"));
}
 
fn up(index: usize, mut order: [u8; 16]) -> ([u8; 16], String) {
order.swap(index, index - 4);
return (order, String::from("u"));
}
 
fn down(index: usize, mut order: [u8; 16]) -> ([u8; 16], String) {
order.swap(index, index + 4);
return (order, String::from("d"));
}
 
fn children(&self, order: &[u8; 16]) -> Vec<([u8; 16], State)> {
let index = State::find_index(order, &0);
let mut new_states: Vec<([u8; 16], State)> = Vec::new();
if COLUMN[index] > 0 {
new_states.push(self.make_move(order, State::left))
}
if COLUMN[index] < 3 {
new_states.push(self.make_move(order, State::right))
}
if ROW[index] > 0 {
new_states.push(self.make_move(order, State::up))
}
if ROW[index] < 3 {
new_states.push(self.make_move(order, State::down))
}
new_states
}
}
 
fn main() {
let mut open_states = KeyedPriorityQueue::<[u8; 16], Reverse<State>>::new();
let start_order = [15, 14, 1, 6, 9, 11, 4, 12, 0, 10, 7, 3, 13, 8, 5, 2];
// let start_order = [0, 1, 2, 3, 5, 6, 7, 4, 9, 10, 11, 8, 13, 14, 15, 12];
open_states.push(start_order, Reverse(State::init(&start_order)));
let mut closed_states = KeyedPriorityQueue::<[u8; 16], Reverse<State>>::new();
 
'outer: while let Some((parent_order, Reverse(parent_state))) = open_states.pop() {
for (child_order, child_state) in parent_state.children(&parent_order) {
match (
open_states.get_priority(&child_order).as_ref(),
closed_states.get_priority(&child_order).as_ref(),
) {
(None, None) => {
if child_order == CORRECT_ORDER {
println!("There are {} entries in the open list.", open_states.len());
println!(
"There are {} entries in the closed list.",
closed_states.len()
);
println!(
"Reaching the final board took {} moves.",
child_state.moves.len()
);
println!("The moves used were {}.", child_state.moves);
println!(
"The final order is:\n{:?}\n{:?}\n{:?}\n{:?}.",
&child_order[0..4],
&child_order[4..8],
&child_order[8..12],
&child_order[12..16]
);
break 'outer;
}
open_states.push(child_order, Reverse(child_state.clone()));
}
(Some(&Reverse(open_state)), None)
if open_state.moves.len() > child_state.moves.len() =>
{
open_states.set_priority(&child_order, Reverse(child_state.clone()));
}
// (None, Some(&Reverse(closed_state))) if closed_state.moves.len() > child_state.moves.len() => {
// closed_states.remove_item(&child_order);
// open_states.push(child_order, Reverse(child_state.clone()));
// },
_ => {}
};
}
closed_states.push(parent_order, Reverse(parent_state));
}
}</syntaxhighlight>
 
{{out}}
<pre>There are 22525454 entries in the open list.
There are 24568220 entries in the closed list.
Reaching the final board took 52 moves.
The moves used were rrruldluuldrurdddluulurrrdlddruldluurddlulurruldrrdd.
The final order is:
[1, 2, 3, 4]
[5, 6, 7, 8]
[9, 10, 11, 12]
[13, 14, 15, 0].</pre>
 
=={{header|Scala}}==
 
Using a weighted A* (not sure if this is the right terminology).
Normally A* sums the heuristic (h) + steps travelled (t) so far.
 
In this solution, we added additional weighting A* = wH * h + wT * t. The reason behind adding this weighting is so that we can fiddle with how much state exploration we want to do. For example, for the main task weighting chosen is wH = 5, wT = 4 so we manage to converge to find one of the 52 steps solution. For the extra credits we choose wH = 2, wT = 1, because we wanted to find fast a solution without exploring much (well I tried, not much luck yet).
 
The more weight given to the heuristics, the less number of states are explored, with the trade off that solution becomes not optimal (longer than expected). As you can see on the output, we found minimum solution for the easy problem, meanwhile with above setting the hard problem was not really solved, it explore only few states and found an unoptimal solution with 98 length.
 
===Implementation===
<syntaxhighlight lang="scala">import scala.collection.mutable
case class Board(table: Array[Int], r: Int, c: Int, parent: List[String] = List()) {
def cloneSwap(r: Int, c: Int, rr: Int, cc: Int) = {
val cTable = table.clone
// Fancy way to access table(r)(c) in linear array
// Equivalent with cTable(r*4 + c)
cTable(r << 2 | c) = table(rr << 2 | cc)
cTable(rr << 2 | cc) = table(r << 2 | c)
cTable
}
def up() =
if (r > 0) { Some(Board(cloneSwap(r, c, r - 1, c), r - 1, c, "u" :: parent))
} else None
def down() =
if (r < 3) { Some(Board(cloneSwap(r, c, r + 1, c), r + 1, c, "d" :: parent))
} else None
def left() =
if (c > 0) { Some(Board(cloneSwap(r, c, r, c - 1), r, c - 1, "l" :: parent))
} else None
def right() =
if (c < 3) { Some(Board(cloneSwap(r, c, r, c + 1), r, c + 1, "r" :: parent))
} else None
def format: String = {
table.sliding(4, 4).toList.map(_.map(i ⇒ f"$i%4d").mkString).mkString("\n")
}
// Manhattan distance
def heuristic() = {
val posF = Board.finalBoard.positionMap
val posT = positionMap
var res = 0;
for (i ← 0 to 15) {
val (x, y) = posF(i)
val (xx, yy) = posT(i)
res += (Math.abs(x - xx) + Math.abs(y - yy))
}
res
}
def key = table.mkString(",")
def travelled() = parent.length
// Find children/neighbours, flatten eliminates the empty boundaries
def children: List[Board] = List(this.up(), this.down(), this.right(), this.left()).flatten
// Map number to positions
lazy val positionMap: Map[Int, (Int, Int)] = {
val res = mutable.Map[Int, (Int, Int)]()
for (x ← 0 to 3; y ← 0 to 3) {
res(table(x << 2 | y)) = (x, y)
}
res.toMap
}
}
 
import Board._
object Solver extends App {
def solve(initBoard: Board, wTravel:Int, wHeuristic: Int ) {
// Setup weights for the heuristic, more weight to heuristic faster but longer solution.
def aStar(b: Board) = wHeuristic * b.heuristic() + wTravel * b.travelled()
implicit val ob = new Ordering[Board] {
override def compare(x: Board, y: Board) = {
aStar(y) - aStar(x)
}
}
val start = System.currentTimeMillis()
var found = false
var head = initBoard
val pq: mutable.PriorityQueue[Board] = new mutable.PriorityQueue()
pq.enqueue(head)
val visited = mutable.HashSet[String]()
var explore = 0
while (pq.nonEmpty && !found) {
head = pq.dequeue()
visited.add(head.key)
if (!head.key.equals(finalBoard.key)) {
val newChildren = head.children.filter(child ⇒ !visited.contains(child.key))
visited ++= (newChildren.map(_.key))
pq.enqueue(newChildren: _*)
explore += 1
} else found = true
if (explore % 5000 == 0)
println(s"# $explore: A* ${aStar(head)} g:${head.travelled()} h:${head.heuristic()}")
}
if (found) {
println(s"Exploring $explore states, solution with length ${head.parent.length}.")
println(s"Weighted heuristic used $wHeuristic * heuristic + $wTravel * travel.")
println(initBoard.format)
println(head.parent.mkString.reverse)
}
println("Total time: " + (System.currentTimeMillis() - start) / 1000.0 + " seconds")
}
solve(startEasy, 4, 5)
solve(startHard, 1, 2 )
}
 
object Board {
val finalBoard = Board(Array(Array(1, 2, 3, 4), Array(5, 6, 7, 8), Array(9, 10, 11, 12), Array(13, 14, 15, 0)).flatten, 3, 3)
val startEasy = Board(Array(Array(15, 14, 1, 6), Array(9, 11, 4, 12), Array(0, 10, 7, 3), Array(13, 8, 5, 2)).flatten, 2, 0)
val startHard = Board(Array(Array(0, 12, 9, 13), Array(15, 11, 10, 14), Array(3, 7, 2, 5), Array(4, 8, 6, 1)).flatten, 0, 0)
}
</syntaxhighlight>
 
===Results===
 
====Standard Task====
<pre>Exploring 698181 states, found solution with length 52.
Weighted heuristic used 5 * heuristic + 4 * travel.
15 14 1 6
9 11 4 12
0 10 7 3
13 8 5 2
rrruldluuldrurdddluulurrrdlddruldluurddlulurruldrrdd
Total time: 48.884 seconds</pre>
 
Retracing: https://scalafiddle.io/sf/iUgGLJS/2
 
====Extra Task, h(2) t(1) ====
<pre>
Exploring 6117 states, found solution with length 106.
Weighted heuristic used 2 * heuristic + 1 * travel.
0 12 9 13
15 11 10 14
3 7 2 5
4 8 6 1
ddrrurdlulddruldrruluuldlddrruulldrrdruuuldlldrdruruuldldrrululdlurdddluurdrdluldrruluurrddldruulddrulurdd
Total time: 0.328 seconds
</pre>
 
Since this is very lightweight exploring very few states, we can even run this on JS
 
https://scalafiddle.io/sf/iUgGLJS/1
 
====Extra Task, h(9) t(5)====
<pre>
Exploring 728832 states, solution with length 98.
Weighted heuristic used 9 * heuristic + 5 * travel.
0 12 9 13
15 11 10 14
3 7 2 5
4 8 6 1
ddrruldrdlururddluuuldlddrruulldrrruuldlldrrruuldldrrululdlurddlurdrrdllluruurrddldllurdrrulldrurd
Total time: 117.666 seconds
</pre>
 
=={{header|Wren}}==
{{trans|Go}}
{{libheader|Wren-long}}
This works but is very slow (132 seconds).
<syntaxhighlight lang="wren">import "./long" for ULong
 
var Nr = [3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3]
var Nc = [3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2]
var n = 0
var n1 = 0
var N0 = List.filled(85, 0)
var N2 = List.filled(85, 0)
var N3 = List.filled(85, 0)
var N4 = List.filled(85, 0)
var i = 1
var g = 8
var e = 2
var l = 4
 
var fN // forward declaration
 
var xx = ULong.fromBaseString("123456789abcdef0", 16)
var fifteen = ULong.new(15)
 
var fY = Fn.new {
if (N2[n] == xx ) return true
if (N4[n] <= n1) return fN.call()
return false
}
 
var fI = Fn.new {
var g = (11 - N0[n]) * 4
var a = N2[n] & (fifteen << g)
N0[n+1] = N0[n] + 4
N2[n+1] = N2[n] - a + (a << 16)
N3[n+1] = "d"
N4[n+1] = N4[n]
var cond = Nr[(a >> g).toSmall] <= (N0[n] >> 2)
if (!cond) N4[n+1] = N4[n+1] + 1
n = n + 1
}
 
var fG = Fn.new {
var g = (19 - N0[n]) * 4
var a = N2[n] & (fifteen << g)
N0[n+1] = N0[n] - 4
N2[n+1] = N2[n] - a + (a >> 16)
N3[n+1] = "u"
N4[n+1] = N4[n]
var cond = Nr[(a >> g).toSmall] >= (N0[n] >> 2)
if (!cond) N4[n+1] = N4[n+1] + 1
n = n + 1
}
 
var fE = Fn.new {
var g = (14 - N0[n]) * 4
var a = N2[n] & (fifteen << g)
N0[n+1] = N0[n] + 1
N2[n+1] = N2[n] - a + (a << 4)
N3[n+1] = "r"
N4[n+1] = N4[n]
var cond = Nc[(a >> g).toSmall] <= N0[n] % 4
if (!cond) N4[n+1] = N4[n+1] + 1
n = n + 1
}
 
var fL = Fn.new {
var g = (16 - N0[n]) * 4
var a = N2[n] & (fifteen << g)
N0[n+1] = N0[n] - 1
N2[n+1] = N2[n] - a + (a >> 4)
N3[n+1] = "l"
N4[n+1] = N4[n]
var cond = Nc[(a >> g).toSmall] >= N0[n] % 4
if (!cond) N4[n+1] = N4[n+1] + 1
n = n + 1
}
 
var fZ = Fn.new { |w|
if (w&i > 0) {
fI.call()
if (fY.call()) return true
n = n - 1
}
if (w&g > 0) {
fG.call()
if (fY.call()) return true
n = n - 1
}
if (w&e > 0) {
fE.call()
if (fY.call()) return true
n = n - 1
}
if (w&l > 0) {
fL.call()
if (fY.call()) return true
n = n - 1
}
return false
}
 
fN = Fn.new {
var p0 = N0[n]
if (p0 == 0) {
var p3 = N3[n]
if (p3 == "l") return fZ.call(i)
if (p3 == "u") return fZ.call(e)
return fZ.call(i + e)
} else if (p0 == 3) {
var p3 = N3[n]
if (p3 == "r") return fZ.call(i)
if (p3 == "u") return fZ.call(l)
return fZ.call(i + l)
} else if (p0 == 1 || p0 == 2) {
var p3 = N3[n]
if (p3 == "l") return fZ.call(i + l)
if (p3 == "r") return fZ.call(i + e)
if (p3 == "u") return fZ.call(e + l)
return fZ.call(l + e + i)
} else if (p0 == 12) {
var p3 = N3[n]
if (p3 == "l") return fZ.call(g)
if (p3 == "d") return fZ.call(e)
return fZ.call(e + g)
} else if (p0 == 15) {
var p3 = N3[n]
if (p3 == "r") return fZ.call(g)
if (p3 == "d") return fZ.call(l)
return fZ.call(g + l)
} else if (p0 == 13 || p0 == 14) {
var p3 = N3[n]
if (p3 == "l") return fZ.call(g + l)
if (p3 == "r") return fZ.call(e + g)
if (p3 == "d") return fZ.call(e + l)
return fZ.call(g + e + l)
} else if (p0 == 4 || p0 == 8) {
var p3 = N3[n]
if (p3 == "l") return fZ.call(i + g)
if (p3 == "u") return fZ.call(g + e)
if (p3 == "d") return fZ.call(i + e)
return fZ.call(i + g + e)
} else if (p0 == 7 || p0 == 11) {
var p3 = N3[n]
if (p3 == "d") return fZ.call(i + l)
if (p3 == "u") return fZ.call(g + l)
if (p3 == "r") return fZ.call(i + g)
return fZ.call(i + g + l)
} else {
var p3 = N3[n]
if (p3 == "d") return fZ.call(i + e + l)
if (p3 == "l") return fZ.call(i + g + l)
if (p3 == "r") return fZ.call(i + g + e)
if (p3 == "u") return fZ.call(g + e + l)
return fZ.call(i + g + e + l)
}
}
 
var fifteenSolver = Fn.new { |n, g|
N0[0] = n
N2[0] = g
N4[0] = 0
}
 
var solve // recursive function
solve = Fn.new {
if (fN.call()) {
System.print("Solution found in %(n) moves: ")
for (g in 1..n) System.write(N3[g])
System.print()
} else {
n = 0
n1 = n1 + 1
solve.call()
}
}
 
fifteenSolver.call(8, ULong.fromBaseString("fe169b4c0a73d852", 16))
solve.call()</syntaxhighlight>
 
{{out}}
<pre>
Solution found in 52 moves:
rrrulddluuuldrurdddrullulurrrddldluurddlulurruldrdrd
</pre>
9,488

edits