Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Main Body | Main Body
Beginner Final Project: Hangman

Scorri per mostrare il menu

book
Main Body

We will be able to test hangman() function while testing the final version of the game.

The hangman function implements the body of the program. Here we need to take into account every possible user guess and print user-communicating messages. We will implement this function in 5 steps for the ease of work.

Compito

Swipe to start coding

  1. Set condition if the word isn't guessed using is_word_guessed function. 2 arguments: gameword & used_letters.
  2. Print available letters using the get_available_letters function. 1 argument: used_letters.
  3. Set condition if the guess is not a letter.
  4. Set condition if the letter (guess) has been used already using the used_letters variable.
  5. Set condition if the letter is in the gameword.
  6. Set condition if the guesses_remaining is equal or lower than 0.
  7. Print the gameword.

THIS CODE RETURNS AND PRINTS NOTHING! WE WILL TEST IT LATER

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 1

Chieda ad AI

expand
ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

book
Main Body

We will be able to test hangman() function while testing the final version of the game.

The hangman function implements the body of the program. Here we need to take into account every possible user guess and print user-communicating messages. We will implement this function in 5 steps for the ease of work.

Compito

Swipe to start coding

  1. Set condition if the word isn't guessed using is_word_guessed function. 2 arguments: gameword & used_letters.
  2. Print available letters using the get_available_letters function. 1 argument: used_letters.
  3. Set condition if the guess is not a letter.
  4. Set condition if the letter (guess) has been used already using the used_letters variable.
  5. Set condition if the letter is in the gameword.
  6. Set condition if the guesses_remaining is equal or lower than 0.
  7. Print the gameword.

THIS CODE RETURNS AND PRINTS NOTHING! WE WILL TEST IT LATER

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 1
Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Siamo spiacenti che qualcosa sia andato storto. Cosa è successo?
some-alt