Giter Club home page Giter Club logo

wordle-helper's Introduction

Wordle Helper

Wordle Helper logo

Wordle is taking Twitter by storm, so I decided to take this opportunity to make something fun and slightly useful and learn how to make a Chrome extension. You can download the extension here.

Demo

The extension will narrow down the possible words based on the game state. Click on the extension to see the count and list of possible answer words remaining. The list of possible answers will update as you enter guesses. Wordle GIF Demo

wordle-helper-demo-2.mp4

Setup

You can download the Chrome extension here, or you can clone the repo and load it as an unpacked extension. Please leave a review if you enjoy the extension!

Both dark mode and high contrast mode are supported based on the settings used on Wordle.

Updating the extension (Chrome Web Store)

Once the extension is ready for publishing, you need to zip the file up for upload to the Chrome Web Store via the Developer Console, which can be done via the following command from the project root:

zip wordle-helper.zip -r * -x .git/* -x *.png -x LICENSE -x README.md

From there upload the zip file to the devconsole and begin the review process. Don't forget to bump the version number in manifest.json!

wordle-helper's People

Contributors

mysticuno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wordle-helper's Issues

Update Wordle list to include other potential NYT solutions

Wordle #646 was GUANO, which was not included in the original Wordle answer list when this was first created (and thus led to 0 suggestions from the extension, not a desired outcome).

I need to either run some statistical analysis on which of all the possible 5 letter words are most likely to be Wordle answers (and perhaps set some arbitrary threshold around 3000-ish) or find some new list of potential solutions.

No longer recognizing NYT Wordle page

The extension has been working great for months! However now it acts as if the browser is not on the wordle page and just displays "Open Today's Wordle" which when clicked just opens another tab to the same Wordle page, and the loop continues.

ariaLabel selectors no longer working

NYT made some more changes to the aria-label properties. Whereas before the first 30 items returned from

let guesses = Array.from(document.querySelectorAll('[data-state]')).slice(0,30).map(item => item.ariaLabel);

would give a consistent set of at least 30 items of the form 'e absent', 'r correct', 'u present', 'empty', that has changed to give more descriptive aria-labels as seen below:

[
  '1st letter, L, absent', '2nd letter, E, absent', '3rd letter, A, absent', '4th letter, S, present in another position', '5th letter, T, absent', 
  '1st letter, C, present in another position', '2nd letter, R, present in another position', '3rd letter, U, present in another position', '4th letter, S, present in another position', '5th letter, T, absent',
  '1st letter, C, present in another position', '2nd letter, U, present in another position', '3rd letter, R, correct', '4th letter, S, present in another position', '5th letter, E, absent', 
  '1st letter, empty', '2nd letter, empty', '3rd letter, empty', '4th letter, empty', '5th letter, empty', 
  '1st letter, empty', '2nd letter, empty', '3rd letter, empty', '4th letter, empty', '5th letter, empty', 
  '1st letter, empty', '2nd letter, empty', '3rd letter, empty', '4th letter, empty', '5th letter, empty',
   'e absent', 'r correct', 't absent', 'u present', 'a absent', 's present', 'l absent', 'c present'
]

With solution "PAUSE", initial guess "MERGE" leads to 0 possible solutions

For the 10/24/2023 Wordle, the solution was PAUSE. For some reason, starting with the guess MERGE led to the extension stating that there were no possible solutions (and there being a mismatch between the possible solutions in the icon and the HTML of the popup):
image

Interestingly enough, if there was another word guessed prior to that, the possible guesses worked as intended:
image

My suspicion is that there's probably a bug in the code that tries to look for words that both have the correct guessed letter but also don't include it. In this case, the letter E is both not present (for the first E in MERGE) but also correct (for the last E in MERGE). I suspect also that it prioritizes letters not being present versus those being present.

Another example is the guess SOUSE for the word PAUSE:
image

Question from a newbie

hey mysticuno, really enjoyed your wordle solver! I had the same idea to make one of these to try out some javascript/html and had made my own version before looking at available google extensions and seeing yours. Yours is so much cooler! I was curious if you could help out a total newbie by sharing any resources on the JSON.parse(window ...) you use to get the board state, or how you figured out to do that... I used this ridiculous document.getElement path that sorted through the DOM (including shadow roots) from the html file I saw when inspecting the page. Thanks so much! (also forgive me if writing an issue isn't the way to ask a question like this I am new to github as well)

Extension broken due to NYT change

NYT no longer uses the nyt-wordle-state variable for storing the game state and guess evaluations, causing reports of the extension being stuck on the same word for multiple days or just being wrong.

It may be possible to get the evaluations from the aria-labels that are applied to the HTML elements that hold the individual letters. It feels a bit hacky, but in the absence of another game state tracker or network requests that we can look at this might be a good step forward.

x = document.querySelectorAll('[data-state]'); // Live collection of classes, only need up to index 29
x[0].ariaLabel // contains the guess and the evaluation like "r present" "a absent" "b correct"
window.localStorage['nyt-wordle-moogle/ANON'] // seems to be where new state is stored

With solution "NOISE", guess "NOOSE" is included as suggestion despite not being solution

This may be related to #5, but if a guess with a repeated letter has that letter marked as both present and absent, the extension will suggest the same guess as a potential solution. In this case, with solution NOISE, guessing NOOSE will mark the first O as correct, but the second O will not be marked as absent. This leads to NOOSE being suggested again:
image

Interestingly enough, Wordle doesn't stop you from entering the same guess multiple times:
image

The problem seems to be specifically with the same letter being marked as correct first and then not being marked as absent, whereas #5 seems to deal with letters being marked as absent first and then also being marked as correct.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.