summaryrefslogtreecommitdiff
path: root/.stack-work/intero/intero3815n6a-STAGING.hs
blob: 5f6fce5e97a4cb15a70b67862c8f672ba4aac4d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module Main where

import Control.Lens
import Linear.V2
import Linear.V3
import Data.Matrix
import System.Random

data Square = X                 -- Attacked
              | Qu              -- Queen
              | O               -- Open/available
  deriving (Show)


--board = V3 <$> [0..8] <*> [0..8] <*> [0]
--board = [(r,c,X) | r <- [0..8], c <- [0..8] ]

lo8 = [0..8] -- list of 8
initBoard = matrix 8 8 $ \_ -> O

firstOpen b = let 
                elem x y = b ! (x, y)
            in map 

nextOpen b = 

solve = let board = initBoard

--avail r c b =

--rowOccupied r b = any (== Q) $ getRow r b
-- placeQueen r c b = board
--   where
--     fX = (\ _ -> X)
--     rowAttacked = mapRow fX r
--     colAttacked = mapCol fx c
--     queen = setElem Qu (r,c) b

--placeAll = repeat 8 placeQueen

winnable = undefined

nextOpen board = undefined 

solve = undefined

-- placeQueen r c =

--b = getE

--placeQueen r c b = b ^.

-- rand = do
--   g <- newStdGen
--   print $ take 8 $ (randomRs (0, 8) g)


-- try r c = let next b = placeQueen r c b
--           in next initBoard

-- try' p = let next b = p b
--           in next initBoard


--res = [ try x y | x <- lo8, y <- lo8 ]

main :: IO ()
main = do
  putStrLn "Hi"