For this assignment, I created a program to demonstrate concepts learned during the first semester of AP Computer Science. I wrote the code, recorded a one-minute video of the program in action, and labeled each part of the code to reflect key concepts like loops, conditionals, and functions. The task allowed me to showcase my coding skills and better understand the material.
For this assignment, I created a digital version of the classic Hangman game using Python. The objective was to build a game that selects a random word from a predefined list and allows the player to guess it, with a set number of attempts (or "lives"). Since Python cannot create physical drawings like the traditional Hangman, this version of the game uses a countdown for remaining lives instead.
I began by creating a list of words from which the game would randomly select a word for the player to guess. The game’s logic involved prompting the player for guesses and displaying the word with blanks for unguessed letters. After each incorrect guess, the player’s remaining lives would decrease, and the game would end when the player either guessed the word correctly or ran out of lives.
The project required implementing several Python functions, such as for generating random words, taking user input, and checking if the player’s guesses were correct. It was a valuable experience in coding both individual functions and integrating them into a complete, interactive program.