So I’m messing around in c#, and was wondering how to generate my string from an array, but with a random color:
while (true)
{
string[] x = new string[] { "", "", "" };
Random name = new Random();
Console.WriteLine((x[name.Next(3)]));
Thread.Sleep(100);
}
When I’m outputting x, I want it to be a random color.
Thanks
If you want to use the standard console colors, you could mix the ConsoleColor Enumeration and Enum.GetNames() to get a random color. You’d then use Console.ForegroundColor and/or Console.BackgroundColor to change the color of the console.