This isn't code for the game itself, which I have nothing to do with.
Note that running the code will require a word list (a text file with a bunch of words separated by newlines). You can generate one here. If you're interested in using the actual wordlist that Wordle uses, follow the instructions here to extract the wordlist from Wordle's JS source code (and note that Wordle uses a different list of possible solutions and possible guesses).