Last active
December 14, 2015 18:09
-
-
Save foxiepaws/5126898 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
-- basic conversion of lowercase to caps using xor, port of logic from bleh.asm. | |
-- aka msify because microsoft LOVES caps. | |
import Data.Bits | |
import Data.Int | |
import Data.Char | |
import Control.Monad | |
caps :: Char -> Char | |
caps x = | |
if x >= 'a' && x <= 'z' then | |
chr(ord(x) `xor` 32) | |
else | |
x | |
bleh :: [Char] -> [Char] | |
bleh x = map caps x | |
main :: IO() | |
main = do | |
when (True) $ do | |
tstring <- getLine | |
putStrLn (bleh tstring) | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment