Wordle in Alteryx!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey all,
I along with many others have added a daily game of Wordle to my morning routine. Inspired by the BaseA challenge for the Advent of Code and exploring the art of what is possible within Alteryx I journeyed down the path of building the game of Wordle in Alteryx. It ended up being an interesting use of chained apps and some of the reporting tools.
For those who don't know Wordle is a basic word puzzle game with a cool backstory. The basic premise is you need to guess a "random" 5 letter word within 6 guesses. Each day a new word is available for you to try to guess. Everytime you guess you get the following information:
- The letter in the position you guessed will be highlighted green if that letter is in the target word in the correct position and location
- The letter in the position you guessed will be highlighted yellow if that letter is in the target word but a different position
- The letter in the position you guessed will be highlighted grey if that letter isn't in the target word
Example from 1/14/2022 (Warning spoiler of the answer)
This seemed like an interesting challenge for Alteryx. So I set upon my journey to build Wordle in Alteryx.
Getting the Word List
The first step in rebuilding Wordle was to get the list of words that are approved and that will be tested. Spoiler for major Wordle fans below
Once we have the dictionary we have to apply the date to the list that way the Alteryx version and the website will display the same word when you're playing the game (I'm sure there are some time zone games that can be played so the words won't align, but I'm not dealing with time zones for a fun project).
So now we have a dictionary of words that can be entered by the user as a guess and the target word that the user is guessing that will change daily.
User Input
The first part of the build was designing the user input. Simple enough allow only 5 letter words on the dictionary list. Should be a simple task but as anyone who knows UX design will tell you users love to do everything except what you want. So how I reigned my users in:
- Allowing only 5 letter words
- Using the Error Message tool I leaned on some Regex to test that the user was truly inputting a 5 letter word. No sneaky special characters or numbers
- length(regex_replace([#1],"[^a-Z]",""))!=5
- Using the Error Message tool I leaned on some Regex to test that the user was truly inputting a 5 letter word. No sneaky special characters or numbers
- Words only from the dictionary
- I tried to use the error message tool, but it turns out Alteryx is not a fan of having an IN statement with 8,000+ words
- Simple enough just run the selected word against the dictionary using a join. If the words not on the list throw an error
Logic Gates
The logic was pretty simple. Parse the word into it's letter components. Join the input word against the target word and apply a formula:
IF [Input Value] = [Test Value]
THEN 2
ELSEIF contains([Test],[Input Value])
THEN 1
ELSE 0
ENDIF
Reporting
I kept it very basic and built out 2 reports:
- Guess Report
- This report tracks your guess and does the background coloring based on what you guesses
- It keeps a log of previous guesses for you information
- Congratulations Screen
- If you get the word you'll also have a congratulations screen appear.
Making the game
To make the game you just need to repeat the above steps. The only change is creating a log to keep track of guesses and updating the reporting so it can handle multiple rounds of data.
I've attached the packaged chained apps. I'm sure there are a few ways to approach this and ways to clean up and optimize. Would love to hear others thoughts!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@bflick Cool! When I first stumbled onto Wordle, I too thought of Alteryx but in a different light. I grabbed the 5 letter words from challenge 75 and built a little interface to have alteryx try and play Wordle. I'm not sure how efficient it is, but it was able to successfully get the handful of days I've tried so far!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@bflick Great post very innovative.
For those interested in solving Wordle, have a read over at datacurious.ai: https://blog.datacurious.ai/down-the-rabbit-hole-17th-january-2022-4af1e7c8693c
Shaan
Co-Founder datacurious.ai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Wordle came up in a conversation with a friend the other day, and I was so proud to say "YES! I've heard of Wordle! I learned about it from @bflick in the Alteryx Community!"
I didn't mention the whole reverse engineering and recreation in Alteryx -- that's way too cool to share with the normals 😂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@DataCurious_Shaan wrote:@bflick Great post very innovative.
For those interested in solving Wordle, have a read over at datacurious.ai: https://blog.datacurious.ai/down-the-rabbit-hole-17th-january-2022-4af1e7c8693c
Shaan
Co-Founder datacurious.ai
Awesome. I'm diving in then! Today's took me all 6 guesses. It might have helped if I wasn't doing it half an hour after I woke up. On the 4th try I had all but the first 2 letters, and it took me about 7 minutes to make the next 2 guesses. lol
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Cool!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
FANTASTIC!
I was just thinking about attempting to do something like this but figure I'd check if someone had already attempted it.
Great job @bflick !! This is amazing and a great way to learn about chained apps! Thank you for this fun challenge/demonstration!
I just wonder if there's a way to avoid the multiple copies (6) of the app and instead use either the same app calling itself recursively, or perhaps 2 apps calling each other in an alternating fashion (app1 calls app2 that then calls app1 again and so on until either the wordle is solved or the 6 attempts are exhausted).
Does anyone know if that's possible? @mceleavey, tagging you since I recall your (mind blowing) frogger game using the the log panel (not to mention the cat dinosaur shirt!) and thought maybe you'd have some insight on this.
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I believe that you can (at least with 2 alternating apps). I don't think 1 would work very well (if at all). I have a project I'm working on for fun that will utilize this back-and-forth chained app behavior.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks @CoG ! Looking forward to an example if/whenever you can share one 😃
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
cool! For those interested in solving Wordle Wordle Hint Answer
