unixy scripts to help you solve that famous word puzzle game
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
These utilities help to solve gurgle puzzles.


STRATEGY

1. Figure out what letters you need
2. Guess the word


WHAT YOU NEED

two files:
* solutions.txt
* guessable.txt
(a basic 5-letter-word list will suffice for both)

posix-compatible programs:
* sh
* grep
* wc
* cat
* tr
* test
* echo
* sort
* uniq
* awk


UTILITIES

* has.sh: filter program for the correct letter in an incorrect position. Called by gurg.sh
* gurg.sh: creates multiple filters for a guess in Guess Syntax
* whatToDo.sh: Gives advice on whether to guess the word, or guess unguessed letters. Has optional threshold parameter.


GUESS SYNTAX

guess G.esS

you guessed the word `guess`, and
* the G was in the correct position
* the U was not present
* the E was in the incorrect position
* the fourth s was in the incorrect position
* the fifth S was in the correct position.


EXAMPLE

```sh
cat solutions.txt | ./whatToDo.sh guessable.txt
# Outputs the Letter Frequency,
# and words that contain the Most Frequent letters.
cat solutions.txt | ./gurg.sh guess ..e.S | ./whatToDo.sh guessable.txt
# Outputs LF and words that contain MF *unguessed* letters.
cat solutions.txt |./gurg.sh guess ..e.S | ./gurg.sh ratio .at.. |./whatToDo.sh guessable.txt
# Outputs a list of Possible Solutions
cat solutions.txt |./gurg.sh guess ..e.S | ./gurg.sh ratio .at.. |./whatToDo.sh guessable.txt 5
# Outputs LF
```


CAVEATS

Currently only supports 5-letter puzzles using ascii characters. Patches welcome.