Solve the no connection puzzle: Difference between revisions

Line 1,263:
 
const HOLES = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
 
const PEGS = [1, 2, 3, 4, 5, 6, 7, 8]
 
const EDGES = [('A', 'C'), ('A', 'D'), ('A', 'E'),
('B', 'D'), ('B', 'E'), ('B', 'F'),
Line 1,275 ⟶ 1,273:
goodtrials = Array{Vector{Int},1}()
for perm in permutations(PEGS)
trial = Dict()
for (i, p) in enumerate(perm)
trial[HOLES[i]] = p
end
goodtrial = true
for edge in EDGES
if abs(trialperm[edge[1] - 'A' + 1] - trialperm[edge[2] - 'A' + 1]) < 2
goodtrial = false
break
Line 1,330 ⟶ 1,324:
5 6
</pre>
 
 
=={{header|Kotlin}}==
4,105

edits