Data Update

This commit is contained in:
Ingy döt Net 2023-07-18 13:51:12 -07:00
parent e50b5c3114
commit 633b36288a
206 changed files with 4762 additions and 965 deletions

View file

@ -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
)$