Skip to content

Go programs for players of Duotrigordle and similar word games

Notifications You must be signed in to change notification settings

mrankine/duotrigordle-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

duotrigordle tools

This repo contains five Go programs which may be useful for players of Duotrigordle and similar word games.

  • maximise-solvable suggests a first guess which maximises the expected number of solvable boards. A board is solvable if there is only one remaining possible solution. The first guess may or may not also be a valid solution.
  • maximise-solvable-pair is as above, but suggests a pair of starting guesses.
  • report-solvable reports solvable boards for a given sequence of one or more guesses.
  • possible-words reports the remaining possible solutions and guesses after a sequence of guesses and responses.
  • guess reports the game's response to a guess, given the solution.

Example usage (results based on 2024-01-14 word list):

  • ./maximise-solvable reports PITON is the guess which maximises solvable boards (43).
  • ./report-solvable PITON prints the 43 solvable boards. For example, if the game responds to PITON with Green Yellow Black Green Black, the solution must be PRIOR.
  • ./possible-words -w PITON BGBGB reports that there are four possible solutions if the response to PITON is Black Green Black Green Black. They are RIGOR, VIGOR, VISOR, and WIDOW.
  • ./guess PITON PRIOR reports Green Yellow Black Green Black.
  • ./maximise-solvable-pair reports the pair CANOE SPRIT maximises solvable boards (667, >25% of the total). The algorithm is not at all optimised. It took ~35 minutes on a Ryzen 3 laptop.

Important caveat: number of solvable boards is only one metric of guess quality. More sophisticated approaches are possible. See, for example, There's A New Best Starter For Perfect Duotrigordle (24 May 2022, uses old word lists).

Build and run

Requires Go, and a terminal with ANSI colour support.

To build:

git clone https://github.com/mrankine/duotrigordle-tools.git
cd duotrigordle-tools
go build -o . ./...

To run:

./maximise-solvable
./maximise-solvable-pair
./report-solvable [-c|--show-codes] guess [guess...]
./possible-words [-w|--show-words] guess response [guess response ...]
./guess guess solution

Where:

  • guess is a five-letter word. Must be present in guesses.txt.
  • solution is a five-letter word. Must be present in solutions.txt.
  • response is the game's response to a guess. Each position of the guess is either Green (correct), Yellow (present), or Black (not in this position). Examples of valid response formats:
    • GYGBB corresponds to Green, Yellow, Green, Black, Black
    • 21200 same as above
    • Y all positions were Yellow

Word lists

Word lists are located in wordlists/{identifier}/{guesses,solutions}.txt. The wordlists directory must be in the same directory as the executables.

The default word list is 2024-01-14, which is consistent with Duotrigordle's 14 January 2024 update.

Specify an alternative word list using the environment variable WORDLIST. Examples:

export WORDLIST=2022-03-03
./maximise-solvable
WORDLIST=my-custom-wordlist ./maximise-solvable

About

Go programs for players of Duotrigordle and similar word games

Topics

Resources

Stars

Watchers

Forks

Languages