In 100 Tagen bei 0

-4234

keine doppelposts bitte… o.0

-4233

Äh.

-4232

Das Pferd frisst keinen Gurkensalat.

-4231

Es handelt sich hier um keinen sinnvollen, Bewusstseins erweiternden, in irgendeiner Form relevanten und absolut unintellektuellen Beitrag von mir. Danke für ihre ungeteilte Aufmerksamkeit!

-4230

Vielen Dank Ingo. Das ist ein äußerst interessanter Gesichtspunkt, den du einmal von einer ganz anderen Seite beleuchtet hast. So wie Tiefseetaucher.

knuff

-4229

Yay, Speicherscheiblette hugs

-4228

im php teil herrscht ja schon wieder krieg :ps:

-4227

wegen php ist überall immer krieg. php ist an allem schuld. o.0

-4226

PHP is love, PHP is life…

-4225

php ist halt $LOL

-4224

ich weiß genau warum ich kein PHP mehr mache :ps:

list($a, $a) = array(1, 2, 3, 4);
$a == 1;

-4223

und ich weiß, warum ich kein pascal mehr mache. beispiele? kA? ich weiß es halt nicht mehr LOL

-4222

Pascal? Ich dachte du triggerst direkt alles in Assembler :ps:

-4221

assembler-“code” ist aber kaum wartbar, daher vermeide ich es. und gcc bekommt das übersetzen gut genug hin :wink:

-4220

void stackoverflow() { stackoverflow(); }

-4219

if (value == 0) return value; else return 0;

-4218

int *a; a = 0; *a = 0;

-4217

phr33k.

-4216

g33k.

-4215

module Lambdabot.Plugin.Elite (elitePlugin) where

import Lambdabot.Plugin
import Lambdabot.Util

import Control.Arrow
import Control.Monad
import Data.Char
import Data.Maybe
import Text.Regex.TDFA

elitePlugin :: Module ()
elitePlugin = newModule
    { moduleCmds = return
        [ (command "elite")
            { aliases = ["leet", "l33t", "1337"]
            , help = say "elite <phrase>. Translate English to elitespeak"
            , process = \args -> case words args of
                 [] -> say "Say again?"
                 wds -> do let instr = map toLower (unwords wds)
                           say =<< io (translateLine instr)
                           
            }
        ]
    }

translateLine :: String -> IO String
translateLine = fmap (dropWhile isSpace) . translate . (' ':)
-- extra space allows whole-word patterns to match at start

translate :: String -> IO String
translate []  = return []
translate str = do
    let alts = [ (subst match',rest)
               | (re, subst) <- ruleList
               , mr <- maybeToList (matchM re str)
               , null (mrBefore mr)
               , let match' = mrMatch mr
                     rest   = mrAfter mr
               ]
    (subst,rest) <- random alts
    liftM (subst ++) (translate rest)

ruleList :: [(Regex, String -> String)]
ruleList = map (first makeRegex)
    [ (".",     id            )
    , (".",     map toUpper   )
    , ("a",     const "4"     )
    , ("b",     const "8"     )
    , (" be ",  const " b "   )
    , ("c",     const "("     )
    , ("ck",    const "xx"    )
    , ("cks ",  const "x "    )
    , ("cks ",  const "x0rs " )
    , ("cks ",  const "x0rz " )
    , (" cool ",const " kewl ")
    , ("e",     const "3"     )
    , ("elite", const "1337"  )
    , ("elite", const "leet"  )
    , ("f",     const "ph"    )
    , (" for ", const " 4 "   )
    , ("g",     const "9"     )
    , ("h",     const "|-|"   )
    , ("k",     const "x"     )
    , ("l",     const "|"     )
    , ("l",     const "1"     )
    , ("m",     const "/\\/\\")
    , ("o",     const "0"     )
    , ("ph",    const "f"     )
    , ("s",     const "z"     )
    , ("s",     const "$"     )
    , ("s",     const "5"     )
    , ("s ",    const "z0rz " )
    , ("t",     const "7"     )
    , ("t",     const "+"     )
    , (" the ", const " teh " )
    , (" to ",  const " 2 "   )
    , (" to ",  const " too " )
    , (" to ",  const " tu "  )
    , (" too ", const " to "  )
    , ("v",     const "\\/"   )
    , ("w",     const "\\/\\/")
    , (" you ", const " u "   )
    , (" you ", const " yu "  )
    , (" you ", const " joo " )
    , ("z",     const "s"     )
    ]