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

Contenu du cours

Beginner Final Project: Hangman

Beginner Final Project: Hangman

1. Game Word
2. Hints
3. Main Body

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.

Tâche

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

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 1
toggle bottom row

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.

Tâche

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

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 1
Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Nous sommes désolés de vous informer que quelque chose s'est mal passé. Qu'est-il arrivé ?
some-alt