init
This commit is contained in:
1
testfiles-custom/1.1.stderr
Normal file
1
testfiles-custom/1.1.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Usage: wordle [-len word-length] [-max max-guesses] [dictionary]
|
||||
7
testfiles-custom/10.1.stdout
Normal file
7
testfiles-custom/10.1.stdout
Normal file
@@ -0,0 +1,7 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
RI--T
|
||||
Enter a 5 letter word (5 attempts remaining):
|
||||
-r--g
|
||||
Enter a 5 letter word (4 attempts remaining):
|
||||
Correct!
|
||||
1
testfiles-custom/2.1.stderr
Normal file
1
testfiles-custom/2.1.stderr
Normal file
@@ -0,0 +1 @@
|
||||
wordle: dictionary file "hello.there.csse2310" cannot be opened
|
||||
1
testfiles-custom/2.2.stderr
Normal file
1
testfiles-custom/2.2.stderr
Normal file
@@ -0,0 +1 @@
|
||||
wordle: dictionary file "/does/not/exist" cannot be opened
|
||||
1
testfiles-custom/2.3.stderr
Normal file
1
testfiles-custom/2.3.stderr
Normal file
@@ -0,0 +1 @@
|
||||
wordle: dictionary file "/var/log/cron" cannot be opened
|
||||
1
testfiles-custom/2.4.stderr
Normal file
1
testfiles-custom/2.4.stderr
Normal file
@@ -0,0 +1 @@
|
||||
wordle: dictionary file "../nope" cannot be opened
|
||||
1
testfiles-custom/2.5.stderr
Normal file
1
testfiles-custom/2.5.stderr
Normal file
@@ -0,0 +1 @@
|
||||
wordle: dictionary file "hello.there.csse2310" cannot be opened
|
||||
1
testfiles-custom/2.6.stderr
Normal file
1
testfiles-custom/2.6.stderr
Normal file
@@ -0,0 +1 @@
|
||||
wordle: dictionary file "/does/not/exist" cannot be opened
|
||||
1
testfiles-custom/2.7.stderr
Normal file
1
testfiles-custom/2.7.stderr
Normal file
@@ -0,0 +1 @@
|
||||
wordle: dictionary file "/var/log/cron" cannot be opened
|
||||
1
testfiles-custom/2.8.stderr
Normal file
1
testfiles-custom/2.8.stderr
Normal file
@@ -0,0 +1 @@
|
||||
wordle: dictionary file "../nope" cannot be opened
|
||||
1
testfiles-custom/3.1.stderr
Normal file
1
testfiles-custom/3.1.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "right".
|
||||
2
testfiles-custom/3.1.stdout
Normal file
2
testfiles-custom/3.1.stdout
Normal file
@@ -0,0 +1,2 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
2
testfiles-custom/3.2.stdout
Normal file
2
testfiles-custom/3.2.stdout
Normal file
@@ -0,0 +1,2 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (3 attempts remaining):
|
||||
4
testfiles-custom/4.1.stdout
Normal file
4
testfiles-custom/4.1.stdout
Normal file
@@ -0,0 +1,4 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must be 5 letters long - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
1
testfiles-custom/4.3.stderr
Normal file
1
testfiles-custom/4.3.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "word".
|
||||
14
testfiles-custom/4.3.stdout
Normal file
14
testfiles-custom/4.3.stdout
Normal file
@@ -0,0 +1,14 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 4 letter word (6 attempts remaining):
|
||||
Words must be 4 letters long - try again.
|
||||
Enter a 4 letter word (6 attempts remaining):
|
||||
Words must be 4 letters long - try again.
|
||||
Enter a 4 letter word (6 attempts remaining):
|
||||
Words must be 4 letters long - try again.
|
||||
Enter a 4 letter word (6 attempts remaining):
|
||||
Words must be 4 letters long - try again.
|
||||
Enter a 4 letter word (6 attempts remaining):
|
||||
Words must be 4 letters long - try again.
|
||||
Enter a 4 letter word (6 attempts remaining):
|
||||
Words must be 4 letters long - try again.
|
||||
Enter a 4 letter word (6 attempts remaining):
|
||||
1
testfiles-custom/5.1.stderr
Normal file
1
testfiles-custom/5.1.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "right".
|
||||
4
testfiles-custom/5.1.stdout
Normal file
4
testfiles-custom/5.1.stdout
Normal file
@@ -0,0 +1,4 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
1
testfiles-custom/5.2.stderr
Normal file
1
testfiles-custom/5.2.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "there".
|
||||
18
testfiles-custom/5.2.stdout
Normal file
18
testfiles-custom/5.2.stdout
Normal file
@@ -0,0 +1,18 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
1
testfiles-custom/5.3.stderr
Normal file
1
testfiles-custom/5.3.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "cat".
|
||||
10
testfiles-custom/5.3.stdout
Normal file
10
testfiles-custom/5.3.stdout
Normal file
@@ -0,0 +1,10 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 3 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 3 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 3 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 3 letter word (6 attempts remaining):
|
||||
Words must contain only letters - try again.
|
||||
Enter a 3 letter word (6 attempts remaining):
|
||||
1
testfiles-custom/6.1.stderr
Normal file
1
testfiles-custom/6.1.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "lines".
|
||||
4
testfiles-custom/6.1.stdout
Normal file
4
testfiles-custom/6.1.stdout
Normal file
@@ -0,0 +1,4 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
1
testfiles-custom/6.2.stderr
Normal file
1
testfiles-custom/6.2.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "guess".
|
||||
12
testfiles-custom/6.2.stdout
Normal file
12
testfiles-custom/6.2.stdout
Normal file
@@ -0,0 +1,12 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
1
testfiles-custom/6.3.stderr
Normal file
1
testfiles-custom/6.3.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "marks".
|
||||
1
testfiles-custom/6.4.stderr
Normal file
1
testfiles-custom/6.4.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "answer".
|
||||
16
testfiles-custom/6.4.stdout
Normal file
16
testfiles-custom/6.4.stdout
Normal file
@@ -0,0 +1,16 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
Word not found in the dictionary - try again.
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
1
testfiles-custom/7.1.stderr
Normal file
1
testfiles-custom/7.1.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "hands".
|
||||
4
testfiles-custom/7.1.stdout
Normal file
4
testfiles-custom/7.1.stdout
Normal file
@@ -0,0 +1,4 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
-----
|
||||
Enter a 5 letter word (5 attempts remaining):
|
||||
1
testfiles-custom/7.2.stderr
Normal file
1
testfiles-custom/7.2.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "guess".
|
||||
12
testfiles-custom/7.2.stdout
Normal file
12
testfiles-custom/7.2.stdout
Normal file
@@ -0,0 +1,12 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
s----
|
||||
Enter a 5 letter word (5 attempts remaining):
|
||||
--E--
|
||||
Enter a 5 letter word (4 attempts remaining):
|
||||
GU--S
|
||||
Enter a 5 letter word (3 attempts remaining):
|
||||
GU--S
|
||||
Enter a 5 letter word (2 attempts remaining):
|
||||
sUg--
|
||||
Enter a 5 letter word (last attempt):
|
||||
1
testfiles-custom/7.3.stderr
Normal file
1
testfiles-custom/7.3.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "marks".
|
||||
10
testfiles-custom/7.3.stdout
Normal file
10
testfiles-custom/7.3.stdout
Normal file
@@ -0,0 +1,10 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
--RKS
|
||||
Enter a 5 letter word (5 attempts remaining):
|
||||
--RKS
|
||||
Enter a 5 letter word (4 attempts remaining):
|
||||
sk-r-
|
||||
Enter a 5 letter word (3 attempts remaining):
|
||||
-----
|
||||
Enter a 5 letter word (2 attempts remaining):
|
||||
1
testfiles-custom/7.4.stderr
Normal file
1
testfiles-custom/7.4.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "answer".
|
||||
12
testfiles-custom/7.4.stdout
Normal file
12
testfiles-custom/7.4.stdout
Normal file
@@ -0,0 +1,12 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
------
|
||||
Enter a 6 letter word (5 attempts remaining):
|
||||
e--an-
|
||||
Enter a 6 letter word (4 attempts remaining):
|
||||
e-----
|
||||
Enter a 6 letter word (3 attempts remaining):
|
||||
----ER
|
||||
Enter a 6 letter word (2 attempts remaining):
|
||||
--n-ER
|
||||
Enter a 6 letter word (last attempt):
|
||||
1
testfiles-custom/8.1.stderr
Normal file
1
testfiles-custom/8.1.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "guess".
|
||||
12
testfiles-custom/8.1.stdout
Normal file
12
testfiles-custom/8.1.stdout
Normal file
@@ -0,0 +1,12 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
s----
|
||||
Enter a 5 letter word (5 attempts remaining):
|
||||
--E--
|
||||
Enter a 5 letter word (4 attempts remaining):
|
||||
GU--S
|
||||
Enter a 5 letter word (3 attempts remaining):
|
||||
GU--S
|
||||
Enter a 5 letter word (2 attempts remaining):
|
||||
sUg--
|
||||
Enter a 5 letter word (last attempt):
|
||||
1
testfiles-custom/8.2.stderr
Normal file
1
testfiles-custom/8.2.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "marks".
|
||||
7
testfiles-custom/8.2.stdout
Normal file
7
testfiles-custom/8.2.stdout
Normal file
@@ -0,0 +1,7 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (3 attempts remaining):
|
||||
--RKS
|
||||
Enter a 5 letter word (2 attempts remaining):
|
||||
--RKS
|
||||
Enter a 5 letter word (last attempt):
|
||||
sk-r-
|
||||
1
testfiles-custom/8.3.stderr
Normal file
1
testfiles-custom/8.3.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "answer".
|
||||
12
testfiles-custom/8.3.stdout
Normal file
12
testfiles-custom/8.3.stdout
Normal file
@@ -0,0 +1,12 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 6 letter word (6 attempts remaining):
|
||||
------
|
||||
Enter a 6 letter word (5 attempts remaining):
|
||||
e--an-
|
||||
Enter a 6 letter word (4 attempts remaining):
|
||||
e-----
|
||||
Enter a 6 letter word (3 attempts remaining):
|
||||
----ER
|
||||
Enter a 6 letter word (2 attempts remaining):
|
||||
--n-ER
|
||||
Enter a 6 letter word (last attempt):
|
||||
1
testfiles-custom/9.1.stderr
Normal file
1
testfiles-custom/9.1.stderr
Normal file
@@ -0,0 +1 @@
|
||||
Bad luck - the word is "right".
|
||||
4
testfiles-custom/9.1.stdout
Normal file
4
testfiles-custom/9.1.stdout
Normal file
@@ -0,0 +1,4 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
Words must be 5 letters long - try again.
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
6
testfiles-custom/9.2.stdout
Normal file
6
testfiles-custom/9.2.stdout
Normal file
@@ -0,0 +1,6 @@
|
||||
Welcome to Wordle!
|
||||
Enter a 5 letter word (6 attempts remaining):
|
||||
--r--
|
||||
Enter a 5 letter word (5 attempts remaining):
|
||||
i---T
|
||||
Enter a 5 letter word (4 attempts remaining):
|
||||
0
testfiles-custom/empty
Normal file
0
testfiles-custom/empty
Normal file
1
testfiles-custom/eof.1
Normal file
1
testfiles-custom/eof.1
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
2
testfiles-custom/eof.2
Normal file
2
testfiles-custom/eof.2
Normal file
@@ -0,0 +1,2 @@
|
||||
marks
|
||||
input
|
||||
1
testfiles-custom/incorrect.1
Normal file
1
testfiles-custom/incorrect.1
Normal file
@@ -0,0 +1 @@
|
||||
tiler
|
||||
5
testfiles-custom/incorrect.2
Normal file
5
testfiles-custom/incorrect.2
Normal file
@@ -0,0 +1,5 @@
|
||||
shift
|
||||
breaD
|
||||
gulps
|
||||
GuLpS
|
||||
suGAr
|
||||
4
testfiles-custom/incorrect.3
Normal file
4
testfiles-custom/incorrect.3
Normal file
@@ -0,0 +1,4 @@
|
||||
works
|
||||
WORKS
|
||||
SKIRT
|
||||
youNG
|
||||
5
testfiles-custom/incorrect.4
Normal file
5
testfiles-custom/incorrect.4
Normal file
@@ -0,0 +1,5 @@
|
||||
uphold
|
||||
expand
|
||||
eXcIte
|
||||
BOTHER
|
||||
HuNtEr
|
||||
1
testfiles-custom/invalid.1
Normal file
1
testfiles-custom/invalid.1
Normal file
@@ -0,0 +1 @@
|
||||
iouyj
|
||||
5
testfiles-custom/invalid.2
Normal file
5
testfiles-custom/invalid.2
Normal file
@@ -0,0 +1,5 @@
|
||||
asdef
|
||||
frozg
|
||||
LHSgd
|
||||
ASDFM
|
||||
NEnVM
|
||||
5
testfiles-custom/invalid.3
Normal file
5
testfiles-custom/invalid.3
Normal file
@@ -0,0 +1,5 @@
|
||||
caulk
|
||||
CAULK
|
||||
abOde
|
||||
ALoft
|
||||
wipED
|
||||
7
testfiles-custom/invalid.4
Normal file
7
testfiles-custom/invalid.4
Normal file
@@ -0,0 +1,7 @@
|
||||
SIXsix
|
||||
LONNNG
|
||||
WOORDS
|
||||
Whichh
|
||||
AARREE
|
||||
NOTTTT
|
||||
validd
|
||||
1
testfiles-custom/nonletters.1
Normal file
1
testfiles-custom/nonletters.1
Normal file
@@ -0,0 +1 @@
|
||||
90210
|
||||
8
testfiles-custom/nonletters.2
Normal file
8
testfiles-custom/nonletters.2
Normal file
@@ -0,0 +1,8 @@
|
||||
don't
|
||||
SS-10
|
||||
12345
|
||||
#2344
|
||||
he11o
|
||||
now!!
|
||||
why?!
|
||||
$7231
|
||||
4
testfiles-custom/nonletters.3
Normal file
4
testfiles-custom/nonletters.3
Normal file
@@ -0,0 +1,4 @@
|
||||
123
|
||||
%$#
|
||||
(*)
|
||||
I'm
|
||||
3
testfiles-custom/right.1
Normal file
3
testfiles-custom/right.1
Normal file
@@ -0,0 +1,3 @@
|
||||
rivet
|
||||
wrong
|
||||
right
|
||||
5
testfiles-custom/right.2
Normal file
5
testfiles-custom/right.2
Normal file
@@ -0,0 +1,5 @@
|
||||
RivEt
|
||||
wRoNg
|
||||
RigHt
|
||||
wORDs
|
||||
valiD
|
||||
37
testfiles-custom/run_wordle.sh
Normal file
37
testfiles-custom/run_wordle.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# Usage: run_wordle.sh answer guess-file [-lines n] [args]
|
||||
# Runs wordle with the given word as the answer with stdin redirected from
|
||||
# the given guess file (one guess per line).
|
||||
# If the -lines argument is given, then only the given number of lines
|
||||
# from standard output will be saved - others will be discarded.
|
||||
# Additional args are given as command line arguments to wordle.
|
||||
if [ "$#" -lt 2 ] ; then
|
||||
echo "Insufficient arguments to $0" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -r "$2" ] ; then
|
||||
echo "Can't read guesses file \"$2\"" >&2
|
||||
exit 2
|
||||
fi
|
||||
answer="$1"
|
||||
guesses="$2"
|
||||
shift 2
|
||||
if [ "$1" = "-lines" -a -n "$2" ] ; then
|
||||
lines="$2"
|
||||
truncatemsg=0
|
||||
shift 2;
|
||||
else
|
||||
# We truncate output after 200 lines - more than enough
|
||||
lines=200
|
||||
truncatemsg=1
|
||||
fi
|
||||
export WORD2310="${answer}"
|
||||
# Run the program and only output the first $lines lines.
|
||||
${wordle:=./wordle-debug} "$@" < ${guesses} | \
|
||||
awk "NR<=${lines} \
|
||||
{print \$0} \
|
||||
NR==${lines}+1&&${truncatemsg} \
|
||||
{print \"Output truncated - exceeds ${lines} lines\"}"
|
||||
# Get wordle's exit status (first command in the pipeline)
|
||||
status=${PIPESTATUS[0]}
|
||||
exit $status
|
||||
1
testfiles-custom/wronglen.1
Normal file
1
testfiles-custom/wronglen.1
Normal file
@@ -0,0 +1 @@
|
||||
byte
|
||||
1
testfiles-custom/wronglen.2
Normal file
1
testfiles-custom/wronglen.2
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
6
testfiles-custom/wronglen.3
Normal file
6
testfiles-custom/wronglen.3
Normal file
@@ -0,0 +1,6 @@
|
||||
these
|
||||
words
|
||||
short
|
||||
andsomeofthemarenotwords
|
||||
ANDsomeOFthemUSEupperCASEletters
|
||||
AndOneOfTheWordsIsReallyLonnnnnnnnnnnnnnnnnnnnnnng
|
||||
Reference in New Issue
Block a user