-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.hs
34 lines (30 loc) · 902 Bytes
/
project.hs
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
--------------------- IMPORTS ------------------------------------
import Types
import Display
import Parser
import Solver
------------------------ MAIN ------------------------------------
main :: IO()
main = do
-- load honeycomb line from file
line <- loadHcLine
-- print loaded line
putStrLn "File content:"
putStrLn line
putStrLn "Parsed honeycomb:"
let hc = parseHc1 line
displayHc hc
if isHcFilled hc then putStrLn "filled" else putStrLn "not filled"
let hc1 = fill hc
displayHc hc1
----------------- LOADING FROM FILE -----------------------------
loadHcLine :: IO String
loadHcLine = do
putStrLn "Give filename:"
-- get file name
fileName <- getLine
-- read file content
fileContent <- readFile fileName
-- return file content
return fileContent
---------------------------------------------------------------