Solve the no connection puzzle: Difference between revisions

Line 282:
3 6
</pre>
 
=={{header|APL}}==
 
{{works with|Dyalog APL 17.0 Unicode}}
 
<lang APL>
 
 
perms←{
⍝∇ 20100513/20140818 ra⌈ --()--
1=⍴⍴⍵:⍵[∇ ⍬⍴⍴⍵]
↑{0∊⍴⍵:⍵ ⋄ (⍺[1]⌷⍵),(1↓⍺)∇ ⍵~⍺[1]⌷⍵}∘(⍳⍵)¨↓⍉1+(⌽⍳⍵)⊤¯1+⍳!⍵
}
 
solution←{
links← (3 4 5) (4 5 6) (1 4 7) (1 2 3 5 7 8) (1 2 4 6 7 8) (2 5 8) (3 4 5) (4 5 6)
tries←8 perms 8
⍝ ⍴⍸~tries{1∊{1∊⍵∊¯1 0 1}¨|(⍺[⍳8])-¨⍺∘{⍺[⍵]}¨⍵}⍤1⊢links
⍝ 16
tries[''⍴solns;]
}
</lang>
 
=={{header|AutoHotkey}}==