1

So unfortunately, I have not even started to code any of this generator, because in fact I do not know how. I am making a Hangman game as a project for my school smart phone programming class, and my partner and I have started to make a hangman game. I already have a wordlist.txt file feeding into a string array; however, I am unsure how to make it so it randomly picks a word from that array.

If Anyone has any idea on how to do so, it would be graciously appreciated.

Thank You!

Colin

Colin
  • 329
  • 2
  • 14

1 Answers1

1

You could do it several different ways. You could assign an int variable a random number using Math.util or RandomNumber. Then loop through your array where i = randomNumber and show that word.

See this stack question for implementation.

That's what I would do.

Community
  • 1
  • 1
Phoenix
  • 1,881
  • 5
  • 20
  • 28