This commit is contained in:
2025-03-21 10:51:17 +10:00
commit 1139e086fc
76 changed files with 2715 additions and 0 deletions

View File

@@ -0,0 +1 @@
Usage: wordle [-len word-length] [-max max-guesses] [dictionary]

View 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!

View File

@@ -0,0 +1 @@
wordle: dictionary file "hello.there.csse2310" cannot be opened

View File

@@ -0,0 +1 @@
wordle: dictionary file "/does/not/exist" cannot be opened

View File

@@ -0,0 +1 @@
wordle: dictionary file "/var/log/cron" cannot be opened

View File

@@ -0,0 +1 @@
wordle: dictionary file "../nope" cannot be opened

View File

@@ -0,0 +1 @@
wordle: dictionary file "hello.there.csse2310" cannot be opened

View File

@@ -0,0 +1 @@
wordle: dictionary file "/does/not/exist" cannot be opened

View File

@@ -0,0 +1 @@
wordle: dictionary file "/var/log/cron" cannot be opened

View File

@@ -0,0 +1 @@
wordle: dictionary file "../nope" cannot be opened

View File

@@ -0,0 +1 @@
Bad luck - the word is "right".

View File

@@ -0,0 +1,2 @@
Welcome to Wordle!
Enter a 5 letter word (6 attempts remaining):

View File

@@ -0,0 +1,2 @@
Welcome to Wordle!
Enter a 5 letter word (3 attempts remaining):

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "word".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "right".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "there".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "cat".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "lines".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "guess".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "marks".

View File

@@ -0,0 +1 @@
Bad luck - the word is "answer".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "hands".

View File

@@ -0,0 +1,4 @@
Welcome to Wordle!
Enter a 5 letter word (6 attempts remaining):
-----
Enter a 5 letter word (5 attempts remaining):

View File

@@ -0,0 +1 @@
Bad luck - the word is "guess".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "marks".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "answer".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "guess".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "marks".

View 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-

View File

@@ -0,0 +1 @@
Bad luck - the word is "answer".

View 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):

View File

@@ -0,0 +1 @@
Bad luck - the word is "right".

View 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):

View 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
View File

1
testfiles-custom/eof.1 Normal file
View File

@@ -0,0 +1 @@

2
testfiles-custom/eof.2 Normal file
View File

@@ -0,0 +1,2 @@
marks
input

View File

@@ -0,0 +1 @@
tiler

View File

@@ -0,0 +1,5 @@
shift
breaD
gulps
GuLpS
suGAr

View File

@@ -0,0 +1,4 @@
works
WORKS
SKIRT
youNG

View File

@@ -0,0 +1,5 @@
uphold
expand
eXcIte
BOTHER
HuNtEr

View File

@@ -0,0 +1 @@
iouyj

View File

@@ -0,0 +1,5 @@
asdef
frozg
LHSgd
ASDFM
NEnVM

View File

@@ -0,0 +1,5 @@
caulk
CAULK
abOde
ALoft
wipED

View File

@@ -0,0 +1,7 @@
SIXsix
LONNNG
WOORDS
Whichh
AARREE
NOTTTT
validd

View File

@@ -0,0 +1 @@
90210

View File

@@ -0,0 +1,8 @@
don't
SS-10
12345
#2344
he11o
now!!
why?!
$7231

View File

@@ -0,0 +1,4 @@
123
%$#
(*)
I'm

3
testfiles-custom/right.1 Normal file
View File

@@ -0,0 +1,3 @@
rivet
wrong
right

5
testfiles-custom/right.2 Normal file
View File

@@ -0,0 +1,5 @@
RivEt
wRoNg
RigHt
wORDs
valiD

View 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

View File

@@ -0,0 +1 @@
byte

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,6 @@
these
words
short
andsomeofthemarenotwords
ANDsomeOFthemUSEupperCASEletters
AndOneOfTheWordsIsReallyLonnnnnnnnnnnnnnnnnnnnnnng