# BOXDIR sandbox
# PROBLEM problem we're evaluating
-[ -n "$2" ] || die "Usage: ev <contestant> <problem>"
+[ -n "$2" ] || die "Usage: ev <contestant> <problem> [<program>]"
CONTESTANT=$1
PROBLEM=$2
dir-init
box-init
# Compile the program
-locate-source
+locate-source $3
compile
# Perform the tests
function locate-source
{
pstart "Finding source... "
+ SBASE=${1:-$PROBLEM}
for a in $EXTENSIONS ; do
- if [ -f $SDIR/$PROBLEM.$a ] ; then
+ if [ -f $SDIR/$SBASE.$a ] ; then
[ -z "$SRCN" ] || die "Multiple source files found: $SDIR/$PROBLEM.$a and $SDIR/$SRCN. Please fix."
- SRCN=$PROBLEM.$a
+ SRCN=$SBASE.$a
SRCEXT=$a
fi
done