Last change
on this file since 269 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
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 | # file: testcase.sh
|
---|
3 | # author: Rick van der Zwet, 0433373
|
---|
4 | # University Leiden, LIACS
|
---|
5 | timesPlayed=0
|
---|
6 | timesWon=0
|
---|
7 | timesLost=0
|
---|
8 | if [ "x$1" == "x" ]; then
|
---|
9 | totalNumber=100
|
---|
10 | else
|
---|
11 | totalNumber=$1
|
---|
12 | fi
|
---|
13 |
|
---|
14 | for puzzle in `cat puzzles17`
|
---|
15 | do
|
---|
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
|
---|
30 | done
|
---|
31 |
|
---|
32 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.