Solve the no connection puzzle: Difference between revisions
Content added Content deleted
Line 1,300:
Append Connections, "E":="ABDFGH","F":="HEB", "G":="CDE","H":="DEF"
Inventory ToDelete, Solutions
\\ eliminate double
con=each(Connections)
While con {
m$=eval$(con, con^)
c$=eval$(con)
If r$
if r$<>"" then {▼
Return connections, d$:=r$
} else {
Return connections, d$:="*" :
}
}
Line 1,328 ⟶ 1,327:
val=Array(arr, Holes(a$))
con$=Connections$(a$)
res=
For i=1 to Len(con$) {
}
=res
Line 1,337 ⟶ 1,336:
h=(,)
solution=(,)
done=
counter=0
Print "Waut..."
Line 1,345 ⟶ 1,344:
Print "Solution:";sol^+1
Disp(Eval(Solutions))
aa$=
}
Sub P(h, a)
local b=cons(a)
For i=1 to len(b) {
Line 1,354 ⟶ 1,353:
P(cons(h,car(b)), cdr(b))
}
End
Sub Process(a)
counter++
Print counter
local sol=Each(Solutions)
While sol {
Print "Solution:";sol^+1
Disp(Eval(Solutions))
aa$=
}
}
Line 1,369:
done=True
While hole {
}
Sub Disp(a)
Print format$(" {0} {1}", array(a), array(a,1))
Line 1,383:
Print " \|/ \|/"
Print Format$(" {0} {1}", array(a,6), array(a,7))
End
}
no_connection_puzzle
|