Skip to content

Instantly share code, notes, and snippets.

@astanin
Created March 18, 2010 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astanin/336267 to your computer and use it in GitHub Desktop.
Save astanin/336267 to your computer and use it in GitHub Desktop.
Upside down
#!/usr/bin/env runhaskell
> import Data.Char (toLower)
Once @malfet wrote: uʍop ǝpısdn ǝʇıɹʍ oʇ pǝsn ǝq uɐɔ sloqɯʎs sɔıʇǝuoɥd.
Indeed, there are upside-down pairs for most of the lower-case letters.
Only 'j' is a problem.
> abc = [ ('a', 'ɐ'), ('b', 'q'), ('c', 'ɔ'), ('d', 'p'), ('e', 'ə')
> , ('f', 'ɟ'), ('g', 'ɓ'), ('h', 'ɥ'), ('i', 'ᴉ'), ('j', 'f')
> , ('k', 'ʞ'), ('l', 'ʅ'), ('m', 'ɯ'), ('n', 'u'), ('o', 'o')
> , ('p', 'd'), ('q', 'b'), ('r', 'ɹ'), ('s', 's'), ('t', 'ʇ')
> , ('u', 'n'), ('v', 'ʌ'), ('w', 'ʍ'), ('x', 'x'), ('y', 'ʎ')
> , ('z', 'z') ]
So let's make a unix filter out of this alphabet:
> main = interact $ unlines .
> map (map ((\c -> maybe c id (lookup c abc)) . toLower) . reverse) .
> reverse . lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment