mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-07 05:38:01 +00:00
17 lines
402 B
Text
17 lines
402 B
Text
{ queens }
|
|
|
|
|
|
{ solves the problem of placing n queens on a }
|
|
{ n*n chessboard without attacking eachother }
|
|
|
|
{ written in false }
|
|
{ by Marcel van Kervinck }
|
|
{ e-mail <marcelk@stack.urc.tue.nl> }
|
|
{ June 1994 }
|
|
|
|
[$0=$[1\]?~[0 2O[$0=~][$$_&$7O7O|_1-&[@1O7O|$+2
|
|
O7O|2/3O_1-7O&6O1-q;!+@@]?_1-&]#%]?\%\%\%\%]q:
|
|
"enter number of queens [0..9] "B^B'0-
|
|
0$@$1[1O0>][$+\1-\]#1-\%\q;!." solutions
|
|
"
|
|
{ that's all }
|