2019-11-24 02:49:57 +01:00
|
|
|
module Main where
|
|
|
|
|
|
|
|
|
|
import Lib
|
2019-12-04 00:13:57 +01:00
|
|
|
import System.Environment
|
|
|
|
|
import System.Random
|
2019-11-24 02:49:57 +01:00
|
|
|
|
|
|
|
|
main :: IO ()
|
2019-12-04 00:13:57 +01:00
|
|
|
main = do
|
|
|
|
|
args <- getArgs
|
|
|
|
|
let boardWidth = read (head args)
|
|
|
|
|
boardLength = read (args !! 1)
|
|
|
|
|
bombs = read (args !! 2)
|
|
|
|
|
generator <- newStdGen
|
|
|
|
|
putStrLn . printBoard . revealAll . createBoard boardWidth boardLength $
|
|
|
|
|
generateRandomCoordinates (boardWidth-1) (boardLength-1) bombs generator
|