view paste/paste.14186 @ 3291:2d02e6041179

<elliott> addquote <Bike> oh my, this is a photo of an elliott fisting [...] <Bike> i meant elephant <Bike> but you know what, ok. <kmc> Bike: ... <kmc> Bike: can you send me that picture when i\'m not at work ok <kmc> plz and thx
author HackBot
date Tue, 09 Jul 2013 22:55:37 +0000
parents e037173e0012
children
line wrap: on
line source

import System.Environment
import System.Process
import System.Exit
import Control.Monad
import Control.Applicative
import Data.List

main = do
    r <- buildRegex . permuteArgs <$> getArgs
    (_, _, _, h) <- createProcess (proc "/hackenv/bin/log" [r])
    exitWith <$> waitForProcess h
   where
     permuteArgs = permutations . join . map words
     buildRegex = oBrackets . intercalate ".*" . map (iBrackets . intercalate "|")
     iBrackets s = "(?:" ++ s ++ ")"
     oBrackets s = "^.*(?:" ++ s ++ ").*$"