from pyutils.parallelize import executors
from pyutils.parallelize import parallelize as par
from pyutils.parallelize import smart_future
-from pyutils.typez import histogram
+from pyutils.types import histogram
logger = logging.getLogger(__name__)
args = config.add_commandline_args(
args.add_argument(
'--solutions_file',
type=str,
- default='/home/scott/bin/wordle_solutions.txt',
+ default='wordle_solutions.txt',
help='Where can I find a valid word list for solutions?',
)
args.add_argument(
'--guesses_file',
type=str,
- default='/home/scott/bin/wordle_guesses.txt',
+ default='wordle_guesses.txt',
help='Where can I find a valid word list for guesses?',
)
args.add_argument(
'--hash_file',
type=str,
- default='/home/scott/bin/wordle_hash.txt',
+ default='wordle_hash.txt',
help='Where can I find my precomputed hash file?',
)
if letter in word_state.letters_excluded:
return False
- # If we already tried this letter in this position and
- # it wasn't green, this isn't a possible solution.
- if n in word_state.letters_at_unknown_positions[letter]:
- return False
-
# If we know a letter is in a position, solution words
# must have that letter in that position.
if (
and letter != word_state.letters_at_known_positions[n]
):
return False
+
+ # If we already tried this letter in this position and
+ # it wasn't green, this isn't a possible solution.
+ if n in word_state.letters_at_unknown_positions[letter]:
+ return False
+
letters_seen[letter] += 1
# Finally, the word must include all letters presently