Wordle GUI Application

Sarah Patterson, Virginia Military Institute, Applied Math

Blain Patterson, Virginia Military Institute, Applied Math

Katherine Ritchey, Mount Union University, Mathematics

Author Profile
Initial Publication Date: October 12, 2023

Summary

We will introduce a project in which students will use Matlab to create a Wordle game GUI application. In this project, students will need to complete a series of tasks in MATLAB, such as data management, GUI creation, random number generation, and programming flow. This project could be done individually or in a group setting, where students are assigned individual tasks to collectively solve the task.

Share your modifications and improvements to this activity through the Community Contribution Tool »

Context for Use

This project was completed in the second semester of a year-long Matlab course for undergraduate stem majors. The typical class size is around 20 students. It has three levels of difficulty that could make the project accessible earlier.

This is a longer project. Students would need approximately two weeks to complete it.

Students should be fairly proficient with MATLAB and be able to write and run scripts and functions. To complete the third level of the project, students should be shown how to create a GUI in matlab.

Students should be introduced to the game Wordle before attempting this project.

This project is situated near the end of the second semester. Students have already created a simple photo editor GUI application.

Description and Teaching Materials

Wordle is a game in which players have six attempts to guess a specific five-letter target word. The target word changes each day. Players start the game by guessing an allowable five-letter word. Feedback about the letters used in this guess is then provided to help the player narrow in on the target word. In particular, letters that are in the correct position are highlighted in green, letters that are in the target word but in the incorrect position are highlighted in yellow, and letters that are not in the target word are highlighted in gray. For example, the image below shows a screenshot of a player's first guess when playing Wordle on The New York Times website (https://www.nytimes.com/games/wordle/index.html). The player used the word "CROWN" as an initial guess. Based on the feedback provided, we know that the letter "C" is in the correct position, the letter "O" is in the target word but in the incorrect position, and the letters "R", "W", and "N" are not in the target word. The player can repeat this process for a total of up to 6 guesses, using this feedback along the way to make more informed guesses.

For this project, students will create a GUI application to play wordle.


Project Description (Microsoft Word 2007 (.docx) 54kB Oct2 23)
C-Level solution (Zip Archive 45kB Oct2 23) 


Assessment

A - Level
Create a GUI to simulate the game wordle. Your GUI should give correct feedback for guesses and solutions with repeated letters.

B - Level
Create a command line version of the Wordle application that gives correct feedback for guesses and solutions with repeated letters. 
or
Create a GUI version of the Wordle application that does not accept guesses and solutions with repeated letters.

C - Level 
Create a command line version of the Wordle application that does not accept guesses and solutions with repeated letters.

References and Resources

To play Wordle, you can visit The New York Times Website: https://www.nytimes.com/games/wordle/index.html.

For additional background information on Wordle and some additional classroom activities, please view the following link: https://www.tandfonline.com/doi/epdf/10.1080/10511970.2023.2193951?needAccess=true.

This teaching activity was created as a part of the Teaching Computation with MATLAB Workshop held in 2023 at Carleton College.