diff options
author | Steven <steven.vasilogianis@gmail.com> | 2019-06-12 20:45:54 -0400 |
---|---|---|
committer | Steven <steven.vasilogianis@gmail.com> | 2019-06-12 20:45:54 -0400 |
commit | cc5dad63219d9951dcc1117ef6cc49b7751ec517 (patch) | |
tree | 90f8dccda3b520444f238b8647566c4018373653 /src/Main.hs | |
parent | 17a1785bbd3efa87995f2e8226aef6763e3c1971 (diff) |
Slight refactoring
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs index 190e997..28afaa7 100644 --- a/src/Main.hs +++ b/src/Main.hs | |||
@@ -10,7 +10,10 @@ main = do | |||
10 | let n = read $ head args :: Int | 10 | let n = read $ head args :: Int |
11 | in putStrLn $ intercalate "\n" $ map show $ solve n | 11 | in putStrLn $ intercalate "\n" $ map show $ solve n |
12 | 12 | ||
13 | data Square = O | X | Qu deriving (Show, Eq) | 13 | -- representation of the state of a square on the board, which can either a |
14 | -- Queen (Q), be under attack by a Queen (X) or open/available (X) | ||
15 | |||
16 | data Square = Qu | X | O deriving (Show, Eq) | ||
14 | 17 | ||
15 | solve :: (Eq n, Num n) => n -> [Matrix Square] | 18 | solve :: (Eq n, Num n) => n -> [Matrix Square] |
16 | solve n = nub $ solveN n | 19 | solve n = nub $ solveN n |