module Main where import System.Environment import Prog import Board import System.Random import System.Time import Text.Printf main = do [n, depth] <- fmap (map read) getArgs -- n is the bord size t1 <- getClockTime setStdGen (mkStdGen 99999) b <- randomBoard n putStrLn $ showBoard b putStrLn $ solve depth b t2 <- getClockTime putStrLn $ printf "time taken: %.2fs" $ secDiff t1 t2 -- func to calc time taken between t0 and t1 in sec secDiff::ClockTime -> ClockTime -> Float secDiff (TOD secs1 psecs1) (TOD secs2 psecs2) = fromInteger (psecs2 - psecs1) / 1e12 + fromInteger (secs2 - secs1)