aboutsummaryrefslogtreecommitdiff
path: root/extract.sh
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2021-01-07 16:49:20 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit27c0576e25226dc75636c372aff3c0818af03201 (patch)
tree8670f0a66c4acaf3fa2375d68a9a9f99b3c46f60 /extract.sh
parent7ee86fd0ee5c6894fe8aa15b89f626220deafc63 (diff)
Check for road wins before flat wins
Diffstat (limited to 'extract.sh')
-rwxr-xr-xextract.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/extract.sh b/extract.sh
index e091a9c..d351244 100755
--- a/extract.sh
+++ b/extract.sh
@@ -4,20 +4,19 @@ db_file=games_anon.db
query() {
echo "SELECT $1 FROM games WHERE (size == $2) \
-and (result != '1-0') and (result != '0-1') and (result != '0-0')\
-and (result != '1/2-1/2');"
+and ((result == 'R-0') or (result == '0-R'));"
+# and (result != '1-0') and (result != '0-1') and (result != '0-0')\
+# and (result != '1/2-1/2');"
}
extract() {
- cd data
- if [ ! -f "$db_file" ]; then
- wget "https://www.playtak.com/games_anon.db"
+ if [ ! -f "data/$db_file" ]; then
+ wget "https://www.playtak.com/games_anon.db" -O "data/$db_file"
fi
- for size in 5 6; do
+ for size in 5; do
echo Extracing games of size "$size"...
- sqlite3 "$db_file" "$(query $1 $size)" | shuf > "playtak-$size"
+ sqlite3 "data/$db_file" "$(query $1 $size)" | shuf > "data/playtak-$size"
done
- cd ..
}
process() {