Skip to content

Instantly share code, notes, and snippets.

@boxp
Created November 26, 2013 15:46
Show Gist options
  • Save boxp/7660718 to your computer and use it in GitHub Desktop.
Save boxp/7660718 to your computer and use it in GitHub Desktop.
--ちんちんっぽいことするやつ
import System.Random
chimpo :: String -> String
randomString :: String -> String
chimpo c = if take 4 c == "ABCDE"
then c ++ ("なんか終わりました" ++ (show (length c )))
else chimpo (randomString c)
randomString s = getStdRandom(randomR(0,4)) >>= \r -> case r of
0 -> ("A" ++ s)
1 -> ("B" ++ s)
2 -> ("C" ++ s)
3 -> ("D" ++ s)
4 -> ("E" ++ s)
main = putStrLn (chimpo (randomString ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment