Skip to content

Instantly share code, notes, and snippets.

@yoichi
Last active August 29, 2015 14:06
Show Gist options
  • Save yoichi/0f8825dec7dd330fb308 to your computer and use it in GitHub Desktop.
Save yoichi/0f8825dec7dd330fb308 to your computer and use it in GitHub Desktop.
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