about | help | code help+videos | done | prefs |
Write a method that helps in making a hangman game. Parameters are as follows: 'hiddenPhrase' will be the correct solution to the hangman game. 'currentShownLtrs' will be the current state of the game, with some letters potentially revealed, but other letters hidden as "*". 'ltr' will be the letter that was just guessed. If 'ltr' is one of the letters that has not yet been revealed, then that letter will not be revealed everywhere it appears in the 'hiddenPhrase'. Look at the test data for examples. The only string methods you may use are .length, .substring, .charAt, and .equals. feb27_2018_APSLHL_hangman("SWIM", "S***", "I") → "S*I*" feb27_2018_APSLHL_hangman("RACECAR", "*******", "A") → "*A***A*" feb27_2018_APSLHL_hangman("WEATHER", "WEA**ER", "J") → "WEA**ER" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 280
Copyright Nick Parlante 2017 - privacy