for file in $(find . -type f -name "*.c" )
do
	gcc $file -lm -std=c99
	./a.out in1.txt out1.txt < inwords1.txt
	./a.out in2.txt out2.txt < inwords2.txt
	echo "Diff for story 1"
	diff -ibyBd out1.txt key1.txt
	read dummy
	echo "Diff for story 2"
	diff -ibyBd out2.txt key2.txt
	read dummy
	echo "Checking return codes, should show 1/2"
	./a.out; echo $?;
	./a.out badin.txt badout.txt; echo $?;
	read dummy;
	cat $file
	echo "Done grading for "+$file+"."
	read dummy
done

