Last active
August 29, 2015 14:06
-
-
Save yoichi/0f8825dec7dd330fb308 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
import Data.Char | |
import System.Environment | |
myLength :: String -> Int | |
myLength [] = 0 | |
myLength (x:xs) = if isAscii x then 1 else 2 + myLength xs | |
main = do | |
args <- getArgs | |
let shi = if null args then "死" else args !! 0 | |
len = myLength shi | |
halflen = (len + 1) `div` 2 | |
putStrLn $ "_人人人人人" ++ (replicate halflen '人') ++ "_" | |
putStrLn $ "> 突然の" ++ shi ++ (if odd len then " " else "") ++ " <" | |
putStrLn $ " ̄Y^Y^Y^Y^Y" ++ (concat $ replicate halflen "^Y") ++ " ̄" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment