Jump to content

N-queens problem: Difference between revisions

m
(One intermediate revision by the same user not shown)
Line 16,578:
N ← 8
Good ← =1⧻◴[⧻◴ ⟜(∩(⧻◴)⊃(+|-)⇡⧻.) ⟜⧻]
⍥(⊏⊚≡Good.☇1⊞⊂⇡,),[[]]N
[[]]
⍥(⊏⊚≡Good.↯⊟∞⧻⊢⊢⟜♭⊞⊂⇡N)N # Could be improved to avoid reshaping?
⟜⧻
RowString ← ⊂"|"/⊂⍜(⊡|"Q|"◌):↯N"_|"
≡≡RowString ⟜⧻⊙◌
</syntaxhighlight>
{{out}}
161

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.