annotate paste/paste.14186 @ 12257:1924fe176291 draft

<fizzie> ` sed -e \'s|wisdom|bin|\' < ../bin/cwlprits > ../bin/cblprits; chmod a+x ../bin/cblprits
author HackEso <hackeso@esolangs.org>
date Sat, 07 Dec 2019 23:36:53 +0000
parents e037173e0012
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e037173e0012 Initial import.
HackBot
parents:
diff changeset
1 import System.Environment
e037173e0012 Initial import.
HackBot
parents:
diff changeset
2 import System.Process
e037173e0012 Initial import.
HackBot
parents:
diff changeset
3 import System.Exit
e037173e0012 Initial import.
HackBot
parents:
diff changeset
4 import Control.Monad
e037173e0012 Initial import.
HackBot
parents:
diff changeset
5 import Control.Applicative
e037173e0012 Initial import.
HackBot
parents:
diff changeset
6 import Data.List
e037173e0012 Initial import.
HackBot
parents:
diff changeset
7
e037173e0012 Initial import.
HackBot
parents:
diff changeset
8 main = do
e037173e0012 Initial import.
HackBot
parents:
diff changeset
9 r <- buildRegex . permuteArgs <$> getArgs
e037173e0012 Initial import.
HackBot
parents:
diff changeset
10 (_, _, _, h) <- createProcess (proc "/hackenv/bin/log" [r])
e037173e0012 Initial import.
HackBot
parents:
diff changeset
11 exitWith <$> waitForProcess h
e037173e0012 Initial import.
HackBot
parents:
diff changeset
12 where
e037173e0012 Initial import.
HackBot
parents:
diff changeset
13 permuteArgs = permutations . join . map words
e037173e0012 Initial import.
HackBot
parents:
diff changeset
14 buildRegex = oBrackets . intercalate ".*" . map (iBrackets . intercalate "|")
e037173e0012 Initial import.
HackBot
parents:
diff changeset
15 iBrackets s = "(?:" ++ s ++ ")"
e037173e0012 Initial import.
HackBot
parents:
diff changeset
16 oBrackets s = "^.*(?:" ++ s ++ ").*$"