diff --git a/lxc/executors/brainfuck b/lxc/executors/brainfuck index 7a82aa5..eb9725d 100755 --- a/lxc/executors/brainfuck +++ b/lxc/executors/brainfuck @@ -1,33 +1,4 @@ #!/bin/bash cd /tmp/$1 -sedarg="\ -s/+/P/g;\ -s/-/M/g;\ -s/>/++p;/g;\ -s/ code.c -#include - -char mem[1<<$MEMSIZE]; -char *p = mem + (1<<$((MEMSIZE - 1))); -int c; - -int main() { - $(timeout -s KILL 3 sed 's/[^][<>.,+-]//g' code.code | timeout -s KILL 3 sed $sedarg) -} -EOF -timeout -s KILL 3 gcc -std=c11 -o binary code.c - -# execution -timeout -s KILL 3 ./binary < args.args < stdin.stdin +timeout -s KILL 3 xargs -a args.args -d '\n' brainfuck code.code < stdin.stdin diff --git a/lxc/executors/zig b/lxc/executors/zig index bc2a971..b046672 100644 --- a/lxc/executors/zig +++ b/lxc/executors/zig @@ -2,5 +2,5 @@ cd /tmp/$1 cp code.code main.zig -timeout -s KILL 10 zig build-exe main.zig && \ +timeout -s KILL 10 zig build-exe main.zig timeout -s KILL 3 xargs -a args.args -d '\n' ./main