...

/

Project: Building a Hangman Game

Project: Building a Hangman Game

Learn how to use an AI assistant to develop a Hangman game with procedural programming techniques, enhancing our coding skills and understanding of game logic.

Guided project: The Hangman

In this lesson, we’ll walk you through the initial steps to solve a project using an AI coding assistant. After we’ve brainstormed the solution together with AI and solved one of the helper functions, we expect you to complete the solution.

Problem statement

Create a Hangman game in which the computer chooses a word and gives a hint related to that word. The player then guesses the hidden word. Each word has a corresponding hint (e.g., “fruit,” “movie,” “place”) that should be displayed alongside the word represented by dashes.

Press + to interact
The hangman builds due to the incorrect guess
1 / 17
The hangman builds due to the incorrect guess

So let’s begin!

Conversation with the AI assistant

Following is the initial part of our conversation with our assistant:

You have to act as my coding assistant and brainstorming partner. Help me generate ideas, suggest best practices, and guide my thought process in a way that aligns with my project goals. I’ll retain full control over the project, so don’t provide any code unless I explicitly request it.

Each suggestion should be clear, concise, and framed as an option or idea, rather than a final solution, to help me improve my coding skills and problem-solving abilities. Ensure I fully understand each part before proceeding, and remember, every line of code requires my approval before it’s written.

I’m ready to help! What project would you like to start with, or what ideas are you thinking about?

Great! We’ll try to make a Hangman game using Python. What options are there for us to explore?

For a Hangman game in Python, we can consider several options:

  • Game Structure:

    • Option 1: A basic loop that runs until the player wins or loses.
    • Option 2: A modular approach with functions for picking a word, checking guesses, and updating the display for better code organization.
  • ...

Access this course and 1400+ top-rated courses and projects.