I have a game of guessing words something like hangman.
This is the code I use to select a word from the words list:
List<string> words = GetWordsList();
int index = new Random().Next(words.Count);
string random = words[index];
Is there a better way to get a random item from the words list?
EDIT 1:
by better I mean (better performance or better randomness or other improvements to consider)
EDIT 2:
I call these lines every 15-30 seconds based on how much time it took to the player to guess the word.
EDIT 3:
I don't know if it is useful, but to have more information about the context, I remove the item from the list after these lines of code.
Randomobject and not create it with every call. If you call this function at very shorts intervals it might be that the time dependent value used for seeding the generator (when it's created) is the same. The result is that it produces the same numbers. So you should try to avoid that.