5 kyu

Wordle! Cheat bot

Description:

Wordle is a game where you try to guess a 5-letter word. https://www.nytimes.com/games/wordle/index.html

After each guess, the color of the tiles (letters) will change to show how close your guess was to the word.

  • Green (G) letter: This letter is in the correct position
  • Yellow (Y) letter: This letter is present in the word, but in the wrong position
  • Grey (-) letter: This letter is not in the word, except when the special rule applies (see below)

For this kata, instead of playing the game like an honest person, you are to write a cheat-bot that filters down the set of words (wordlist) using a list of guesses and their respective feedbacks. For example, if you were provided this wordlist and feedbacks:

{"SHEEP", "KINKY", "SWEET", "MAUVE", "FLUNG", "SKEET", ... }  # wordlist
[("SPOIL", "G----"), ("STEAD", "GYG--"), ("SEETH", "GYGY-")]  # guesses

Your output should be the set of remaining words, each satisfying all the hints in guesses:

{'SWEET', 'SKEET'}   # <- your output

And because you are special, this kata will not be restricted to 5-letter words!! The word length for each test case, however, would be consistent with the guesses. If the test case asks for a 9-letter word, all guesses in the hints would be of length 9. Make sure you can handle some big words!

!! There are special rules when the same character appears multiple times in the guesses and/or the solution. After assigning greens to all applicable tiles, any remaining guessed characters will be assigned yellow until no matching character is left in the solution, the rest will be assigned grey. For example, if the solution is "ATARI", and the guess is "ABBAA", the hint would be "G--Y-"

Puzzles

Stats:

CreatedApr 12, 2022
PublishedApr 12, 2022
Warriors Trained869
Total Skips19
Total Code Submissions2654
Total Times Completed78
Python Completions78
Total Stars45
% of votes with a positive feedback rating89% of 27
Total "Very Satisfied" Votes23
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes2
Total Rank Assessments5
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • boyanci Avatar
  • Voile Avatar
  • mauro-1 Avatar
Ad