marking/mark02b
changeset 96 abfcb6111d33
parent 86 f8a781322499
child 98 8f03f0dc3065
--- a/marking/mark02b	Tue Dec 13 13:02:52 2016 +0000
+++ b/marking/mark02b	Wed Jan 11 14:40:53 2017 +0000
@@ -12,7 +12,7 @@
 echo "" >> $out
 
 function scala_vars {
-   (egrep 'var|return|ListBuffer|mutable' "$1" 2> /dev/null 1> /dev/null)
+   (egrep '\bvar\b|\breturn\b|ListBuffer|mutable' "$1" 2> /dev/null 1> /dev/null)
 }
 
 
@@ -66,7 +66,33 @@
 fi
 
 
+if [ $tsts1 -eq 0 ]
+then
+  echo " ordered_moves(8, List((3,4), (3,2)), (1,3)) == (0,1), (0,5), (2,1), (2,5)" | tee -a $out
+  echo " ordered_moves(8, List((4,0)), (0,0)) == (2,1), (1,2)" | tee -a $out
+  echo " ordered_moves(8, List((0,4)), (0,0)) == (1,2), (2,1)" | tee -a $out
+  
+  if (scala_assert "knight3.scala.bak" "../../../marking/knight3a_test.scala")
+  then
+    echo "  --> success" | tee -a $out
+    marks=$(( marks + 1 ))
+  else
+    echo "  --> test failed" | tee -a $out
+  fi
+fi
 
+if [ $tsts1 -eq 0 ]
+then
+  echo " first_closed_tour_heuristic(6, List((3, 3))) is ok?" | tee -a $out
+  
+  if (scala_assert "knight3.scala.bak" "../../../marking/knight3b_test.scala")
+  then
+    echo "  --> success" | tee -a $out
+    marks=$(( marks + 1 ))
+  else
+    echo "  --> test failed" | tee -a $out
+  fi
+fi
 
 
 ## final marks