How we built the famous word game : Wordle!

Options
GauravSetia
edited March 2023 in Modeling

You all must be aware of the global phenomenon of “Wordle”. The way this little and simple word game struck the world is amazing! We loved this game so much, we tried to test our beloved software, Anaplan’s, limits yet again and tried to recreate this game on it. This is how we built Wordle on Anaplan inspired from https://community.anaplan.com/discussion/147317/how-i-built-it-popular-word-game.

Setup:

For a game of wordle, the player will have to guess a word. To “get” or “create” a guessable word, we first created a list of all the legal words (5 letter words) in the English dictionary in Anaplan.


Step 1 - We named the list “legal words”. As only 1 word can be played at a single time for a game of wordle so, we took up the “1 word a day” approach of wordle and made a “day list” in Anaplan, containing numbers from 1-31.

Note: You can add as many numbers in the list. 1-31 numbers in our list implies the player can only guess 31 words on our game.


Step 2- Now, we make module using the above 2 lists, “Days” as a dimension and “legal words” as a list formatted line item (see line item “Word” in the above picture).

This module then contains line items that breaks the word into single individual alphabets as visible on the above screenshot. These stripped alphabets will be used to verify each individual alphabet inputted by the player which will be explained later.

Note: We have also added a “Legal?” line item which checks the word inputted in “Word” to be in the list for legal words in case the “Word” line item is formatted as text


Step 3- Next, we need a playing arena for the players to type in the alphabets to form a word while guessing it, for that we created a “Tries” list with 6 members. It contains the numbers from 1 to 6, as visible on the left of the above image and corresponds to each single try a player is allowed to guess a new word.

The line items shown in the above screenshot are saved in a view solely for the purpose of guessing a word. The first 5-line items correspond to individual letters of the word that combine to form a word. The “Can submit?” Boolean item checks if the inputted word exists in the “legal words” list or in the dictionary.

For this module, “tries” list is used in rows and “Days” list is used as a Page selector.

The letters put in this module flows into a system module.


This module has the same dimension as of the Gameplay Module and finds each and every letter in the inputted module (module name: Gameplay) and checks the position of the letter in the word to be guessed and provides a unique number for every case and every try. These numbers are then imported into the “Gameplay” module with an action to apply conditional formatting on the Gameplay grid.

Step 4 -The action to clear up the grids is created as a “Restart” button. The player can select to play different words by changing the Context Selector on the top right of the page.

(Note: The current “day” or number on the context selector is “1” which corresponds to the word “since” as we saw in the first image).

We also added an additional functionality on the UX Page. When all the chances are used up, a KPI card shows the word the player failed to guess. This looks like this:


You can also play with DCA and conditional formatting for a better UX design and gameplay.




And this is how we made a working WORDLE in Anaplan. Hope you guys find it informative and Entertaining as well.