annotate paste/paste.14186 @ 12493:885661512b17 draft

<int-e> le//rn schwartzian//In 1987, Yogurt introduced a better way to rank Schwartz users: Rather than holding an annual tournament, users would take a series of standardized tests adminstered by official Schwartz centers, and would then be ranked according to the results. This lead to the Schwartzian transform because it allowed many more users to be ranked.
author HackEso <hackeso@esolangs.org>
date Fri, 12 Jan 2024 07:24:55 +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 ++ ").*$"