Skip to content

Instantly share code, notes, and snippets.

@TakashiHarada
Created August 17, 2015 13:58
Show Gist options
  • Save TakashiHarada/886b3ca4a12a6dc576de to your computer and use it in GitHub Desktop.
Save TakashiHarada/886b3ca4a12a6dc576de to your computer and use it in GitHub Desktop.
import Data.Char
import System.IO
import System.Random
import System.Environment
numListToString :: [Int] -> String
numListToString [] = []
numListToString (x:xs) = (show x) ++ "\n" ++ numListToString xs
main = do
args <- getArgs
gen <- getStdGen
-- putStrLn "Enter a number of Section"
-- n <- getLine
let n' = read (head args) :: Int
xs = take (n'*3) $ (randomRs (1,100) gen) :: [Int]
--mapM_ print xs
writeFile "randomPath.txt" (numListToString xs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment