142 |
139 |
143 ### knight3 test |
140 ### knight3 test |
144 |
141 |
145 if [ $tsts -eq 0 ] |
142 if [ $tsts -eq 0 ] |
146 then |
143 then |
147 echo " count_tours from every position on the board 1 - 4" | tee -a $out |
144 echo " count_tours from every position on the board 1 - 4 (0.5% marks)" | tee -a $out |
148 echo " dim = 1: 1" | tee -a $out |
145 echo " dim = 1: 1" | tee -a $out |
149 echo " 2: 0,0,0,0" | tee -a $out |
146 echo " 2: 0,0,0,0" | tee -a $out |
150 echo " 3: 0,0,0,0,0,0,0,0,0" | tee -a $out |
147 echo " 3: 0,0,0,0,0,0,0,0,0" | tee -a $out |
151 echo " 4: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" | tee -a $out |
148 echo " 4: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" | tee -a $out |
152 START=$(date +%s) |
149 START=$(date +%s) |
153 |
150 |
154 if (scala_assert "knight1.scala" "knight1_test3a.scala") |
151 if (scala_assert_thirty "knight1.scala" "knight1_test3a.scala") |
155 then |
152 then |
156 END=$(date +%s) |
153 END=$(date +%s) |
157 DIFF=$(( $END - $START )) |
154 DIFF=$(( $END - $START )) |
158 echo " It took $DIFF seconds" | tee -a $out |
155 #echo " This test ran for $DIFF seconds." | tee -a $out |
159 echo -e " --> success\n" | tee -a $out |
156 echo -e " --> success\n" | tee -a $out |
160 marks=$(( marks + 0.5 )) |
157 marks=$(( marks + 0.5 )) |
161 else |
158 else |
162 END=$(date +%s) |
159 END=$(date +%s) |
163 DIFF=$(( $END - $START )) |
160 DIFF=$(( $END - $START )) |
164 echo " It took $DIFF seconds" | tee -a $out |
161 echo " This test ran for $DIFF seconds." | tee -a $out |
165 echo -e " --> ONE TEST FAILED\n" | tee -a $out |
162 echo -e " --> ONE TEST FAILED\n" | tee -a $out |
166 fi |
163 fi |
167 fi |
164 fi |
168 |
165 |
169 |
166 |
170 if [ $tsts -eq 0 ] |
167 |
171 then |
168 if [ $tsts -eq 0 ] |
172 echo " count_tours from every position on the board of dim 5" | tee -a $out |
169 then |
173 echo " dim = 5: 304,0,56,0,304,0,56,0,56,0,56,0,64,0,56,0,56,0,56,0,304,0,56,0,304" | tee -a $out |
170 echo " count_tours from every position on the board of dim 5 for the first 3 rows (0.5% marks)" | tee -a $out |
|
171 echo " dim = 5: 304,0,56,0,304,0,56,0,56,0,56,0,64,0,56)" | tee -a $out |
174 START=$(date +%s) |
172 START=$(date +%s) |
175 |
173 |
176 if (scala_assert "knight1.scala" "knight1_test3b.scala") |
174 if (scala_assert_thirty "knight1.scala" "knight1_test3b.scala") |
177 then |
175 then |
178 END=$(date +%s) |
176 END=$(date +%s) |
179 DIFF=$(( $END - $START )) |
177 DIFF=$(( $END - $START )) |
180 echo " It took $DIFF seconds" | tee -a $out |
178 #echo " This test ran for $DIFF seconds." | tee -a $out |
181 echo -e " --> success\n" | tee -a $out |
179 echo -e " --> success\n" | tee -a $out |
182 marks=$(( marks + 0.5 )) |
180 marks=$(( marks + 0.5 )) |
183 else |
181 else |
184 END=$(date +%s) |
182 END=$(date +%s) |
185 DIFF=$(( $END - $START )) |
183 DIFF=$(( $END - $START )) |
186 echo " It took $DIFF seconds" | tee -a $out |
184 echo " This test ran for $DIFF seconds." | tee -a $out |
187 echo -e " --> ONE TEST FAILED\n" | tee -a $out |
185 echo -e " --> ONE TEST FAILED\n" | tee -a $out |
188 fi |
186 fi |
189 fi |
187 fi |
|
188 |
190 |
189 |
191 |
190 |
192 if [ $tsts -eq 0 ] |
191 if [ $tsts -eq 0 ] |
193 then |
192 then |
194 echo " enum_tours(5, List((0,2)) ) => 56 tours? and all correct?" | tee -a $out |
193 echo " enum_tours(5, List((0,2)) ) => 56 tours? and all correct?" | tee -a $out |
195 echo " enum_tours(5, List((0,0)) ) => 304 tours? and all correct?" | tee -a $out |
194 echo " enum_tours(5, List((0,0)) ) => 304 tours? and all correct?" | tee -a $out |
196 START=$(date +%s) |
195 START=$(date +%s) |
197 |
196 |
198 if (scala_assert "knight1.scala" "knight1_test3c.scala") |
197 if (scala_assert_thirty "knight1.scala" "knight1_test3c.scala") |
199 then |
198 then |
200 END=$(date +%s) |
199 END=$(date +%s) |
201 DIFF=$(( $END - $START )) |
200 DIFF=$(( $END - $START )) |
202 echo " It took $DIFF seconds" | tee -a $out |
201 #echo " This test ran for $DIFF seconds." | tee -a $out |
203 echo -e " --> success\n" | tee -a $out |
202 echo -e " --> success\n" | tee -a $out |
204 marks=$(( marks + 1.0 )) |
203 marks=$(( marks + 1.0 )) |
205 else |
204 else |
206 END=$(date +%s) |
205 END=$(date +%s) |
207 DIFF=$(( $END - $START )) |
206 DIFF=$(( $END - $START )) |
208 echo " It took $DIFF seconds" | tee -a $out |
207 echo " This test ran for $DIFF seconds." | tee -a $out |
209 echo -e " --> \n ONE TEST FAILED\n" | tee -a $out |
208 echo -e " --> \n ONE TEST FAILED\n" | tee -a $out |
210 fi |
209 fi |
211 fi |
210 fi |
212 |
211 |
213 |
212 |
214 ## final marks |
213 ## final marks |
215 echo -e "Overall mark for the Preliminary Part 4 (Scala)" | tee -a $out |
214 echo -e "Overall mark for the Preliminary Part 4 (Scala)" | tee -a $out |
216 printf " %0.1f\n" $marks | tee -a $out |
215 printf " %0.1f\n" $marks | tee -a $out |
217 |
216 |
218 |
217 |
|
218 |