Skip to content

Instantly share code, notes, and snippets.

@omegatakuma
Created December 17, 2011 13:43
Show Gist options
  • Save omegatakuma/1490245 to your computer and use it in GitHub Desktop.
Save omegatakuma/1490245 to your computer and use it in GitHub Desktop.
AVTOKYOでチケットを買う時はこのプログラムを是非。
avtokyo t = do
putStr "当日8000円(a)/前売り5000円(b)/合計(c)"
s <- getChar
putStr "\n"
case s of
'a' -> avtokyo (t + 8000)
'b' -> avtokyo (t + 5000)
'c' -> return t
_ -> (do putStr "入力 "; avtokyo t)
main = do
putStrLn "AVTOKYOのチケットを買うんですね?"
n <- buy 0
putStrLn ("全部で"++(show n)++"円です。お金は足りますか?!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment