Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

susanjrobertson

  • 3 years ago

I'm working on the hangman project - Project 1. I'm a bit stuck on the 6th step. I need to do the print_guessed function. I get that I should do a loop of for i in secret_word? Any help is appreciated. Thanks!

  • This Question is Closed
  1. liliy
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    not sure if this is what you need but: perhaps make a for loop that makesword into array of chars then make a for loop that compares each one to the word they are trying to guess and if its correct print out char else "-". for(int i=0;i<myWord.length;i++){ if(guessWord[i]==myWord[i]) print guessWord[i]; else print "-" }

  2. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy