<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ioana Daria</title>
    <description>The latest articles on DEV Community by Ioana Daria (@ioanadaria).</description>
    <link>https://dev.to/ioanadaria</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3927833%2F426c3c1b-5e12-4c04-bb0e-3afa851ef8fe.jpeg</url>
      <title>DEV Community: Ioana Daria</title>
      <link>https://dev.to/ioanadaria</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ioanadaria"/>
    <language>en</language>
    <item>
      <title>I Built a Wordle Clone in Python - Here's How You Can Too</title>
      <dc:creator>Ioana Daria</dc:creator>
      <pubDate>Tue, 12 May 2026 19:22:51 +0000</pubDate>
      <link>https://dev.to/ioanadaria/i-built-a-wordle-clone-in-python-heres-how-you-can-too-58gc</link>
      <guid>https://dev.to/ioanadaria/i-built-a-wordle-clone-in-python-heres-how-you-can-too-58gc</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Wordle took the world by storm in 2022 — a simple daily word puzzle that had millions of people sharing colored squares on social media. What made it so compelling wasn't complexity - it was clarity. You get six guesses to find a hidden five-letter word, and each guess tells you exactly how close you are.&lt;/p&gt;

&lt;p&gt;I wanted to understand that magic from the inside, so I built my own Wordle clone that runs entirely in the terminal using Python. This project was part of a personal challenge to build an interactive terminal program from scratch, version-control it with Git, and write about it. Whether you're a beginner looking for a fun project or a developer who wants to see how color-coded terminal output works, this post is for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What It Looks Like&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpr8f354n518jyjnj59nf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpr8f354n518jyjnj59nf.png" alt=" " width="792" height="504"&gt;&lt;/a&gt;&lt;br&gt;
Caption: The Wordle clone running in the terminal with color-coded feedback&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How the Code Works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The full source is on GitHub: [&lt;a href="https://github.com/ioanadaria/wordle-clone" rel="noopener noreferrer"&gt;https://github.com/ioanadaria/wordle-clone&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;The program is built around three core ideas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;ANSI color codes for terminal styling&lt;br&gt;
Standard Python print() can't produce colored output on its own, but terminals support ANSI escape codes — special character sequences that change text color and background. Green (\033[42m) marks a correct letter in the right position, yellow (\033[43m) marks a correct letter in the wrong position, and gray (\033[100m) means the letter isn't in the word at all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Two-pass feedback logic&lt;br&gt;
Scoring a guess against the secret word sounds simple but has a subtle edge case: duplicate letters. The get_feedback() function handles this with two passes — the first pass locks in all exact (green) matches, removing those letters from consideration. The second pass then checks remaining letters for yellow matches. This prevents a letter from being double-counted.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Input validation with input()&lt;br&gt;
Every guess is validated in a loop: it must be exactly five characters and contain only letters. If not, the player is prompted again. This keeps the game from crashing on bad input and makes it feel polished.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The game loop itself is clean — six attempts, feedback after each guess, a win message if the player solves it, and a "play again?" prompt at the end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Building this Wordle clone taught me more than I expected. The color output alone opened up a whole area of terminal programming I hadn't explored before, and the duplicate-letter problem forced me to think carefully about state. It's a small project, but it has real depth hiding inside it.&lt;/p&gt;

&lt;p&gt;If you want to extend it, here are some ideas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load the word list from an external .txt file&lt;/li&gt;
&lt;li&gt;Track and display win streaks&lt;/li&gt;
&lt;li&gt;Add a hard mode that forces you to reuse confirmed letters&lt;/li&gt;
&lt;li&gt;Port it to a web app using Flask&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;The full code is available here: [&lt;a href="https://github.com/ioanadaria/wordle-clone" rel="noopener noreferrer"&gt;https://github.com/ioanadaria/wordle-clone&lt;/a&gt;] — feel free to fork it, break it, and make it your own.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
