tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
18
Task/N-queens-problem/Ursala/n-queens-problem.ursala
Normal file
18
Task/N-queens-problem/Ursala/n-queens-problem.ursala
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#import std
|
||||
#import nat
|
||||
|
||||
remove_reflections = ^D(length@ht,~&); ~&K2hlPS+ * ^lrNCCs/~&r difference*D
|
||||
remove_rotations = ~&K2hlrS2S+ * num; ~&srlXSsPNCCs
|
||||
|
||||
#executable <'par',''>
|
||||
#optimize+
|
||||
|
||||
queens =
|
||||
|
||||
%np+~command.options.&h.keyword.&iNC; -+
|
||||
~&iNC+ file$[contents: --<''>+ mat` *+ %nP*=*],
|
||||
remove_rotations+ remove_reflections+ ~&rSSs+ nleq-<&l*rFlhthPXPSPS,
|
||||
~&i&& ~&lNrNCXX; ~&rr->rl ^/~&l ~&lrrhrSiF4E?/~&rrlPlCrtPX @r ^|/~& ^|T\~& -+
|
||||
-<&l^|*DlrTS/~& ~&iiDlSzyCK9hlPNNXXtCS,
|
||||
^jrX/~& @rZK20lrpblPOlrEkPK13lhPK2 ~&i&& nleq$-&lh+-,
|
||||
^/~&NNXS+iota -<&l+ ~&plll2llr2lrPrNCCCCNXS*=irSxPSp+ ^H/block iota; *iiK0 ^/~& sum+-
|
||||
Loading…
Add table
Add a link
Reference in a new issue