Wordle (an update)

def get_score_counts_for_each_guess(guesswords, words):
outer_results = {}
for guess in guesswords:
results = list(get_scores(guess, words).values())
outer_results[guess] = sum(results)/len(results)
return outer_results
  • If the word in BEATS and you guess SEATS, it won’t mark the first letter as yellow, as it has already confirmed that the final letter is S.
  • If you guess SEATS and the word is FEAST, it won’t mark both of your S’s as yellow, just the first one.
def score_word(guess, actual):
outcome = [0,0,0,0,0]
tempword = list(actual)
for i, c in enumerate(guess):
if tempword[i]==c:
outcome[i]=2
tempword[i]='0'
for i, c in enumerate(guess):
if c == 0:
if (c in tempword):
outcome[i]=1
tempword[tempword.index(c)] = '0'
return tuple(outcome)

--

--

--

Fascinated by what makes societies and markets work, especially in sustainable energy. http://guylipman.com. Views not necessarily reflect those of my employer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Save up to 90% of all Academic software on OnTheHub

From Zero to PSM I, less than 24 hours!

How to create indexes in Mongodb

Global Microserver Market is projected to reach a value of over USD 71 billion by 2027

Not Asking Questions Is Still Your Ego Talking

Kotlin Coroutines Cheat Sheet

How to generate, play and solve Sudoku puzzles in R

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Guy Lipman

Guy Lipman

Fascinated by what makes societies and markets work, especially in sustainable energy. http://guylipman.com. Views not necessarily reflect those of my employer.

More from Medium

The Art of Wordle

The Best Wordle

Wordle Unwinds

2022 Predictions: Space, Wearables and Future of Work.