source: liacs/ai/sudoku/testcase.sh@ 300

Last change on this file since 300 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

  • Property svn:executable set to *
File size: 602 bytes
RevLine 
[2]1#!/bin/sh
2# file: testcase.sh
3# author: Rick van der Zwet, 0433373
4# University Leiden, LIACS
5timesPlayed=0
6timesWon=0
7timesLost=0
8if [ "x$1" == "x" ]; then
9 totalNumber=100
10else
11 totalNumber=$1
12fi
13
14for puzzle in `cat puzzles17`
15do
16 let "timesPlayed+=1"
17 sleep 1
18 ./sudoku -c $2 | ./sudoku -f - >/dev/null
19 if [ "x$?" == "x0" ]; then
20 let "timesWon+=1"
21 else
22 let "timesLost+=1"
23 fi
24 echo "Played: ${timesPlayed}"
25 echo "won : ${timesWon}"
26 echo "lost : ${timesLost}"
27 if [ "x${timesPlayed}" == "x${totalNumber}" ]; then
28 break
29 fi
30done
31
32
Note: See TracBrowser for help on using the repository browser.