The B Programming Language by kimiyuki

#!/usr/bin/env runhaskell

import Data.Char

g :: [String] -> (Bool, [String])
g ("true" : s)  = (True, s)
g ("false" : s) = (False, s)
g ("if" : s) =
    let (p, "then" : s') = g s
        (q, "else" : s'') = g s'
        (r, s''') = g s''
    in (if p then q else r, s''')

f :: String -> String
f = map toLower . show . fst . g . words

main :: IO ()
main = interact $ unlines . map f . lines

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page