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

I want to make an app, how much time do I need?

[ Linux ] Create Screens In Loop And Execute Command In Side It

VNMT’s NetSuite

Thoughts on Implementing an Analytics-Friendly Data Solution for a Web Application

Data center; your data is stored here!

Why do we need Robotic Process Automation (RPA)?

Introduction to Model-Driven Test Design

User Behavior in Digital Applications

Bringing the Imagination to Life

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 Religion of Jeff Bezos: Is Jeff Bezos is a Jewish?

Why The Matrix Resurrections Sucked Ass

Why I quit Medical School.