summaryrefslogtreecommitdiff
path: root/.stack-work/intero/intero3815n6a-STAGING.hs
diff options
context:
space:
mode:
Diffstat (limited to '.stack-work/intero/intero3815n6a-STAGING.hs')
-rw-r--r--.stack-work/intero/intero3815n6a-STAGING.hs69
1 files changed, 0 insertions, 69 deletions
diff --git a/.stack-work/intero/intero3815n6a-STAGING.hs b/.stack-work/intero/intero3815n6a-STAGING.hs
deleted file mode 100644
index 5f6fce5..0000000
--- a/.stack-work/intero/intero3815n6a-STAGING.hs
+++ /dev/null
@@ -1,69 +0,0 @@
1module Main where
2
3import Control.Lens
4import Linear.V2
5import Linear.V3
6import Data.Matrix
7import System.Random
8
9data Square = X -- Attacked
10 | Qu -- Queen
11 | O -- Open/available
12 deriving (Show)
13
14
15--board = V3 <$> [0..8] <*> [0..8] <*> [0]
16--board = [(r,c,X) | r <- [0..8], c <- [0..8] ]
17
18lo8 = [0..8] -- list of 8
19initBoard = matrix 8 8 $ \_ -> O
20
21firstOpen b = let
22 elem x y = b ! (x, y)
23 in map
24
25nextOpen b =
26
27solve = let board = initBoard
28
29--avail r c b =
30
31--rowOccupied r b = any (== Q) $ getRow r b
32-- placeQueen r c b = board
33-- where
34-- fX = (\ _ -> X)
35-- rowAttacked = mapRow fX r
36-- colAttacked = mapCol fx c
37-- queen = setElem Qu (r,c) b
38
39--placeAll = repeat 8 placeQueen
40
41winnable = undefined
42
43nextOpen board = undefined
44
45solve = undefined
46
47-- placeQueen r c =
48
49--b = getE
50
51--placeQueen r c b = b ^.
52
53-- rand = do
54-- g <- newStdGen
55-- print $ take 8 $ (randomRs (0, 8) g)
56
57
58-- try r c = let next b = placeQueen r c b
59-- in next initBoard
60
61-- try' p = let next b = p b
62-- in next initBoard
63
64
65--res = [ try x y | x <- lo8, y <- lo8 ]
66
67main :: IO ()
68main = do
69 putStrLn "Hi"