Skip to content

Instantly share code, notes, and snippets.

@nushio3
Last active December 15, 2015 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nushio3/5253576 to your computer and use it in GitHub Desktop.
Save nushio3/5253576 to your computer and use it in GitHub Desktop.
main :: IO ()
main = top 10
top :: Int -> IO ()
top mp = do
putStrLn $ "あなたのMPは:" ++ show mp
putStrLn "どこへ行く?"
choice [ ("宿屋" , inn)
, ("野外" , outdoor mp) ]
inn = do
putStrLn "あなたはぐっすり眠った。"
top 10
outdoor mp = do
putStrLn "マネジメント上の問題が現れた!!どうする?"
choice [ ("殴る" , fight)
, ("メラ" , magic 3 mp)
, ("イオナズン", magic 100 mp) ]
fight = do
putStrLn "_人人人人人人人_"
putStrLn "> 突然の突き指 <"
putStrLn " ̄Y^Y^Y^Y^Y^Y^Y ̄"
putStrLn "あなたは死にました・・・"
magic costMp mp
| costMp > mp = do
putStrLn "MPが足りない"
putStrLn "あなたは死にました・・・"
| otherwise = do
putStrLn "炎上マーケティング!!"
putStrLn "マネジメント上の問題を解決した"
top (mp - costMp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment