I'm trying to make a simple rock paper scissors game. I need the computer to randomly choose a string from the array of ROCK, PAPER, and SCISSORS. This is what I have so far:
public string GetComputerChoice()
{
string computerChoice = null;
string[] computerChoices = { "ROCK", "PAPER", "SCISSORS" };
return computerChoice[Random.Next(computerChoices.Length)];
}
The only error I am getting in Visual Studio is for 'Next' which says 'Random does not contain a definition for 'Next'.
I am entirely new to programming as a whole. Any tips for why this isn't working or what I could do to make it work? I've read other replies on similar posts but it seems all the answers are just blocks of code to make it work with no explanation for why it works.