Skip to content
Snippets Groups Projects
Commit be1bb5d6 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Turnier-Software

parent 2db7aada
Branches
No related tags found
No related merge requests found
#!/bin/bash
echo "score wins draws"
for x in *.score; do
printf "%4d %4d %4d %-15s\n" \
$(wc -c "$x" | sed -e 's/ .*$//') \
$(( $(grep -o "\*" "$x" | wc -l) / 3 )) \
$(grep -o "+" "$x" | wc -l) \
$(basename $x .red.score)
done \
| sort -rn
#!/bin/bash
if [ "$1" = "-s" ]; then
core_size="$2"
shift 2
fi
if [ -n "$1" ]; then
PARTICIPANTS="$@"
else
PARTICIPANTS=$(ls *.red)
fi
#PARTICIPANTS="nothing.red knirps.red mice.red $1"
PMARS="$HOME/bo/2012ws/rtech/material/pmars-0.9.2/src/pmars-ncurses"
mars ()
{
c1=$2
c2=$3
if [ -n "$core_size" ]; then
set $($PMARS -8 -b -k -p 64 -s $core_size $2 $3)
else
set $($PMARS -8 -b -k -p 64 -s $1 $2 $3)
fi
if [ $1 = 1 ]; then
echo -n "***" >> $c1.score
touch $c2.score
elif [ $3 = 1 ]; then
touch $c1.score
echo -n "***" >> $c2.score
else
echo -n "+" >> $c1.score
echo -n "+" >> $c2.score
fi
}
rm -f *.score
./turn $PARTICIPANTS \
| sort -R \
| tee tournament.log \
| while read line; do
$line
done
./scores
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
srand (42);
for (char **p = argv + 1; *p; p++)
for (char **q = p + 1; *q; q++)
for (int i = 0; i < 100; i++)
printf ("mars %d %s %s\n",
512 + rand () % (8192 - 512 + 1), *p, *q);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment