Code a Hangman Game using Python from Scratch!! Part 2 - Win/Loss, Draw Outputs, and Track Guesses!!

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024
  • This is part two of a two part tutorial showing how to create the classic word guessing game 'hangman' using python and pycharm! The previous episode covered creation of the code, receiving user input for guesses, handling guesses that are too long, and checking to see if the guesses are correct or not. Upon a good guess where it is a letter that appears in the answer, we update the secret word to show the letters that have been guessed!
    In this video we will handle keeping track of all past guesses, handling win/lose scenarios and drawing our dead guy as he gets progressively closer to being filled out and the game being over!
    If you like the content from this page please like and subscribe to the channel to see lots more like this! Thanks so much for supporting the page and good luck coding!
    / @lemastertech

ความคิดเห็น • 6

  • @HamRan-qw3lb
    @HamRan-qw3lb 3 หลายเดือนก่อน +1

    Thanks. Really easy to follow!

    • @lemastertech
      @lemastertech  3 หลายเดือนก่อน

      You got it thanks for watching!!

  • @DenykaBrown
    @DenykaBrown ปีที่แล้ว +1

    Hey! A friend of mine was using your code to learn python and we noticed that the code errored out if too many letters were entered at the same time. I added another if statement in the while loop to fix it and it runs smoothly now!
    Thanks for the tutorial!

    • @lemastertech
      @lemastertech  ปีที่แล้ว

      Hey awesome fix! Sometimes I definitely assume the player will play properly and don’t put a lot of time in there for error and exception handling to keep tutorials concise, but that sounds like you’ve got it all figured out, good work and thanks for watching!!

  • @jeremyhurst66
    @jeremyhurst66 9 หลายเดือนก่อน +1

    Is there a way to add a list of words instead of having someone input a word to guess so the computer chooses a random word from the list?

    • @lemastertech
      @lemastertech  9 หลายเดือนก่อน

      Hello, yes this is pretty easy! Just make a Python list, fill it with all the words you want as options and then instead of asking for user input just import the random module and set the secret word equal to random.choice(words_list)
      Hope this helps!!