• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps stuck in hangman app development

Hi guys I am new to android and I am trying to develop and hangman app. I want to replace the character with '__' , for example in case of "apple" I want to have some thing like "a_pl_" .But I am stuck without any idea to do it. I don't want the code, I just want some inputs so that I can develop it on my own.
 
Last edited:
You could use string.replace('_','a').

The hard part is coming up with the algorithm. You could have two different strings, one to check which guesses are correct (String word = "apple") and one to display the word (String display = "a_pl_"). Use a loop to search through the word comparing characters and for all the ones that match use the replace function, but make the change on the display string.
 
  • Like
Reactions: anandandroid
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones