-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan.sh
More file actions
executable file
·40 lines (38 loc) · 1.36 KB
/
scan.sh
File metadata and controls
executable file
·40 lines (38 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
for f in $*; do
echo "############ $f"
cat $f | strings | egrep "(Value|Outcome)" \
| awk '/Value/ {
v[n] = $2; n = n + 1
}
/Outcome/ {
if (n > 20) {
if ($2 == "BLACK") {
print "1. BLACK"
}
else if ($2 == "WHITE") {
print "7. WHITE"
}
else if (n < 200) {
if (n % 2 == 0) {
print "6. ADVANTAGE_WHITE"
} else {
print "2. ADVANTAGE_BLACK"
}
}
else {
if (v[n-11] > 0.1) {
print "3. DRAW_LEAN_BLACK"
} else if (v[n-11] < -0.1) {
print "5. DRAW_LEAN_WHITE"
} else {
print "5. DRAW_EVEN"
}
}
} else {
print "8. SHORT"
}
n=0
}' \
| sort | uniq -c | cut -b 1-8,11-
done