Day 7 of 100

Published: (January 6, 2026 at 05:37 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Day 7 of 100: Writing Algorithms

Choosing a Project

I started the day by brainstorming simple game ideas and translating them into algorithms. After sketching a few concepts on paper and refining them in draw.io, I settled on creating a Hangman game and wrote the algorithm before beginning the actual build.

Preparing the Word List

The first step was to compile a list of possible words. This turned out to take more time than writing the program itself, but it gave the game a solid foundation.

Core Implementation

  • Underscore Replacement – Used for loops to replace each letter in the chosen word with an underscore.
  • User Guess Handling – Created a guess variable to capture the player’s input.
    • If the guessed letter exists in the word, the corresponding underscore(s) are replaced with that letter.
    • If the guessed letter is not in the word, the player loses a life.
    • If the letter has already been guessed, the player is informed that it was previously tried.
  • Game Loop – Wrapped the entire logic in a while loop that continues until:
    1. The user correctly guesses the whole word, or
    2. The user runs out of lives.

Reflection

Overall, building the Hangman game was a fun and educational mini‑project that reinforced my understanding of loops, conditionals, and user input handling.

Back to Blog

Related posts

Read more »

🎮 Retro Hangman '95 Using KIRO

!Cover image for 🎮 Retro Hangman '95 Using KIROhttps://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-t...

Coding Challenge Practice - Question 97

Problem Description The task is to find the k‑th largest element in an unsorted array that may contain duplicates. The k‑th largest element is the element that...