3 Copy the following commands to the SCL console:
7 > allPositions = [0..n-1]
8 > possibleNextPositions l = allPositions \\ (l + lq + uq)
11 lq = [l!i - (m-i) | i <- [0..m-1]]
12 uq = [l!i + (m-i) | i <- [0..m-1]]
13 > expandSolution l = do
14 x <- possibleNextPositions l
16 > solve k cur = if k == n
18 else expandSolution cur >>= solve (k+1)
19 > solutions = solve 0 []
21 > repeatString k (s :: String) = sum [s | x <- [1..k]]
22 > rowText k = repeatString k "." + "X" + repeatString (n-k-1) "."
23 > printSolution (l :: [Integer]) = do
24 printString (repeatString n "-")
25 mapM (printString . rowText) l
26 > mapM printSolution solutions