
What
A complete graphical implementation of the word game Wordle: a 6×5 tile grid, an on-screen keyboard that tracks the state of every letter, a help screen, win and lose screens, and player statistics that persist between sessions. The course brief capped the text-only version at a B+ grade, so the full GUI was the target from the start.
How
About 1,700 lines of C across some thirty functions, built on a modified gfx
X11 wrapper (gfx_mod.c) because no GUI framework was permitted. The codebase
was split into distinct layers — user interface, core game logic, keyboard state,
input validation, and persistence.
Guesses pass three stages of validation: rejecting non-alphabetic input, wrong
word lengths, words absent from the 200-word dictionary, and words containing a
repeated letter. Feedback is generated first as a compact * / # / _ string,
then mapped in one pass onto both the coloured tiles and the on-screen keyboard
so the two can never disagree. Word selection runs through an unused_condition()
check against a session history array so no answer repeats. Per-player statistics
— games played, wins, accumulated green tiles and average attempts — are written
to a history file keyed by username.
Outcome
Delivered at the top grading tier as a 700×700 windowed game, well past the text-only baseline. The persistent statistics system was not part of the brief and was added on top of the required scope.
Gallery
Click any image to enlarge