I am making a rock, paper, scissors, lizard, Spock game. I already did it and it works perfectly! But there is a line of code that I've been using for two days now and I don't know the meaning of. Here it is:
{weapon2chose[bot_weapon_chosen]}
I use it in order to take a random word from a string array and then print the word instead of just a number with the random class like this:
Console.WriteLine($"You fought against {weapon2chose[bot_weapon_chosen]} and lost...");
This is the random code I use as well:
string[] weapon2chose = {"rock", "paper", "scissors", "lizard", "Spock" };
Random and = new Random();
int bot_weapon_chosen = rnd.Next(weapon2chose.Length);
I'd like you to explain to me what the {}
brackets are and how does it print out a string instead of a number.