September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
5
Task/N-queens-problem/Scala/n-queens-problem-3.scala
Normal file
5
Task/N-queens-problem/Scala/n-queens-problem-3.scala
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
for(v<-(0 to 7).permutations.filter(v=>(0 to 7).forall(i=>(i+1 to 7).
|
||||
forall(j=>j-i!=Math.abs(v(i)-v(j)))))){
|
||||
println("_"*15)
|
||||
v.map(i=>println("_|"*i+"Q"+"|_"*(7-i)))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue