Skip to content

Instantly share code, notes, and snippets.

@pikulet
Created March 6, 2020 19:34
Show Gist options
  • Save pikulet/fdc68f0dd093aa4e0b06178b5f861c3e to your computer and use it in GitHub Desktop.
Save pikulet/fdc68f0dd093aa4e0b06178b5f861c3e to your computer and use it in GitHub Desktop.
Helper tool to help build your starters for Jotto :)
import string
import enchant
dictionary = enchant.Dict("en-US")
all_letters = string.ascii_lowercase;
def run():
words = list()
current_letters = all_letters;
while True:
print(" ".join(current_letters))
command = input("Enter a word, exit or reset\n")
if command == "exit":
break
if command == "reset":
print(words)
words = list()
current_letters = all_letters
continue
if len(set(command)) != 5:
print("Invalid jotto word")
continue
if not dictionary.check(command):
print("Invalid english word")
continue
length = len(current_letters)
next_letters = sorted(set(current_letters).difference(set(command)))
if length - len(next_letters) != 5:
print("Repeated letters used")
continue
else:
current_letters = next_letters
words.append(command)
if __name__ == "__main__":
run()
@pikulet
Copy link
Author

pikulet commented Mar 6, 2020

You need python3, pip3 install pyenchant first.

Example starters (thanks SteelixMega!!)

  • crwth plums fidge banjo
  • thong plums fiver bawdy
  • xylem batch fjord pinks
  • zloty swank chimp fudge
  • qophs wacky glint femur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment