Data Update
This commit is contained in:
parent
e50b5c3114
commit
633b36288a
206 changed files with 4762 additions and 965 deletions
|
|
@ -1,11 +1,13 @@
|
|||
/* Inspired by code from Python */
|
||||
Queens(N):=block([K,C,P,V,A,S,L:[]],
|
||||
Queens(N):=block([K,C,P,V,L:[]],
|
||||
C: makelist(K,K,1,N),
|
||||
P: permutations(C),
|
||||
for V in P do (
|
||||
A: length(unique(makelist(V[K]+K, K, C))),
|
||||
S: length(unique(makelist(V[K]-K, K, C))),
|
||||
if is(A=N) and is(S=N) then L: cons(V, L)
|
||||
if is(N=length(unique(makelist(V[K]+K, K, C)))) then (
|
||||
if is(N=length(unique(makelist(V[K]-K, K, C)))) then (
|
||||
L: endcons(V, L)
|
||||
)
|
||||
)
|
||||
), L
|
||||
)$
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue