minesweeper-haskell/app/Main.hs
Paul-Henri Froidmont fd1aef44ef Place bombs randomly
2019-12-04 00:13:57 +01:00

15 lines
431 B
Haskell

module Main where
import Lib
import System.Environment
import System.Random
main :: IO ()
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