Created
June 18, 2016 07:00
-
-
Save aiya000/d1cef2044320ad52597e9a656f321045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Text ( Text, pack ) | |
import qualified Data.Text.IO as TIO | |
import System.Random.Shuffle | |
type ZuQueue = [Text] | |
genDoko :: IO Text | |
genDoko = do | |
zun <- shuffleM [pack "ズン", pack "ドコ"] | |
return . head $ zun | |
zuqueue :: IO ZuQueue | |
zuqueue = do | |
zun <- genDoko | |
doko <- zuqueue | |
return $ zun : doko | |
main :: IO () | |
main = do | |
q <- zuqueue | |
mapM_ TIO.putStrLn $ take 10 q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment