#! /usr/local/bin/tcsh -f

set projDir = /home/comp210/Projects/Connect5

## This script creates an output file,
## which should then be load'd by a mzscheme process.
#
#set dataDir = $projDir/Tourney
#set ssf = $dataDir/minimalScheme.ss
#set inf = $dataDir/minimalScheme.in
#echo When script finished, run \"mzscheme -r $ssf \< $inf\"
#
#\rm -f $ssf
#touch $ssf
#\rm -f $inf
#touch $inf

foreach student ( `echo $argv` )
  #echo \(printf \"\~n\~n\~ntesting $student\~n\"\) >> $ssf
  echo testing $student
  set ss = /home/$student/comp210/final/connect5.ss
  #set ss = $projDir/Tourney/snafus/$student/connect5.ss
  foreach trial ($projDir/Tests/Wins/*)
    #echo against $trial
    if ($trial:r == $trial) then
      #echo \(current-namespace \(make-namespace\)\) >> $ssf
      #echo \(printf \"Answer should be `cat $trial.out`: \"\) >> $ssf
      echo Answer should be `cat $trial.out`:
      #echo \(load \"$ss\"\) >> $ssf
      #cat $trial >> $inf
      mzscheme -r $ss < $trial
      endif
    end
  end
