Skip to content

How to make a game like Wordle

5 min readBy Eduardo Orellana ·

Wordle is two ideas: colours that tell you how close each guess was, and one puzzle a day for everyone. Both fit on one screen, and the whole game is a few hundred lines. The part most clones get wrong is a single rule about repeated letters, so this post runs it on Godot 4.7.2 before it says anything else.

Leer en español

Wordle is a feedback rule with a calendar attached

Josh Wardle released Wordle publicly in October 2021, and The New York Times bought it in January 2022. In between, it went from a game he made for his partner to millions of players a day, without an app, an account or an advert.

Strip the story away and there are two mechanics. Every guess returns a colour per letter: green for the right letter in the right place, yellow for a letter that is in the word somewhere else, grey for a letter that is not there. And everyone gets the same word, once a day, so you can share how you did without spoiling it.

The obvious reading is that the colours are the game. They are not, quite. The colours are only as good as the rule that decides them, and that rule has one case that trips up almost every first attempt.

The rule most clones get wrong is repeated letters

Guess EERIE when the answer is THEME. The last E is green. THEME has two Es, one of which that green E has already used, so exactly one more E can be yellow. A naive check, which asks only whether each letter appears anywhere in the answer, colours both of the first two Es yellow and tells the player THEME has three Es.

The fix is two passes. First mark every green and count the answer's letters that were not matched. Then walk the guess again and give a yellow only while that letter still has a spare left. The function below is that rule in GDScript, the way it would sit in a Godot 4 project.

We ran it headless on Godot 4.7.2, the engine the Flockbay app ships, against five pairs. CRANE against ABIDE came back grey, grey, yellow, grey, green. SPEED against ABIDE gave one yellow E, not two, and a yellow D. EERIE against THEME gave one yellow E and a green E. LLAMA against HELLO gave two yellow Ls, because HELLO really has two spare Ls. ABIDE against itself was five greens. Each is what Wordle shows.

GDScript
static func score(guess: String, answer: String) -> PackedInt32Array:
	# 2 = right place, 1 = in the word, 0 = absent.
	var result := PackedInt32Array()
	result.resize(guess.length())
	var spare := {}
	for i in answer.length():
		if guess[i] == answer[i]:
			result[i] = 2
		else:
			spare[answer[i]] = spare.get(answer[i], 0) + 1
	for i in guess.length():
		if result[i] == 2:
			continue
		var left: int = spare.get(guess[i], 0)
		if left > 0:
			result[i] = 1
			spare[guess[i]] = left - 1
	return result

The daily answer is arithmetic, not a server

Everyone gets the same word because the answer is picked from a fixed list by the date. Count the days since some start day and take that number modulo the length of the list. Godot's Time singleton gives the date; Time.get_unix_time_from_datetime_string() turns a day into seconds, and dividing by 86,400 gives a day number. On our run, 18 October 2026 was day 20,744.

No server is needed, which is a large part of why Wordle could spread before anyone had built infrastructure for it. The cost is that the list ships with the game, so a determined player can read tomorrow's answer. Wordle accepted that, and so can you: the people who would cheat a daily puzzle are not the people it is for.

Use the player's local date, not UTC, or the puzzle changes in the middle of the evening for half your players.

The share grid is the marketing

The coloured squares you paste into a group chat are the result with the letters removed. They tell your friends how hard the day was and how you fared, and they spoil nothing. Every player who shares is an advert, which is how a game with no marketing reached millions.

Build it as text: one emoji square per tile, one row per guess, and the puzzle number on top. In Godot, DisplayServer.clipboard_set() puts it on the clipboard. Test it by pasting it into the apps your players use, because a grid that does not survive a paste into a phone's messaging app is not doing its job.

The first playable is one screen and six rows

Build in this order. One hidden answer and six rows of five tiles, each a Panel with a Label. Typing fills the current row; Enter scores it with the function above and colours the tiles; Backspace removes a letter. A guess that is not in the word list is refused with a shake, not scored, or players will burn guesses on nonsense to fish for letters.

Then an on-screen keyboard that remembers the best colour each letter has earned, so a green key never goes back to yellow. Then the daily answer. Then the share grid. Then a streak count saved to user:// with FileAccess. Stop there. Wordle's strength was how little it had.

A Godot GridContainer with five columns lays out the tiles, and a Tween on each tile's scale gives the flip. Keep the board and the keyboard in Control nodes so the layout follows the window on a phone.

Test it on the third day, not the first

If guesses feel like luck, the feedback is not teaching. Check the scoring with the repeated-letter cases above before anything else; a wrong yellow is the fastest way to lose a player's trust.

If people solve it in two guesses, the answer list is too easy. Wordle's answers are common five-letter words, but its accepted guesses are a much longer list, so players can probe with odd words without the answer ever being odd.

Then give it to the same person three days running. A daily puzzle is judged on the third day, when the novelty is gone and only the rule is left.

Your twist is the thing being guessed

Dozens of daily puzzles followed Wordle within months, and the ones that lasted kept the feedback loop and changed the subject. Worldle guesses a country from its outline, with distance and direction as the feedback. Nerdle guesses an equation. Framed guesses a film from its stills.

So do not change the colours; change what they describe. Pick a subject your players know better than everyone else, and design the feedback so every wrong guess still teaches. That is the game, and the rest is the few hundred lines above.

2D, flat, and built for a phone

A daily puzzle lives in a few seconds on a phone. A clean 2D grid is right; 3D would only get in the way. In the Flockbay app you can ask for exactly this build order, and it writes the GDScript, runs the game headless to check the scoring, and plays it so you can judge the feel.

A daily puzzle is feedback that teaches and one answer a day.

Read more game design notes

Flockbay

The free AI game maker for Windows, macOS and Linux.