𝙇𝙤𝙤𝙣𝙖 💢
𝙇𝙤𝙤𝙣𝙖 💢
CC#
Created by krazycay on 4/19/2023 in #help
❔ how can i make C# writeline change color every second
@kaos I've sent you a DM. Feel free to check it whenever and I'll try and help as well.
79 replies
CC#
Created by krazycay on 4/19/2023 in #help
❔ how can i make C# writeline change color every second
Am I missing code that's been provided?
79 replies
CC#
Created by krazycay on 4/19/2023 in #help
❔ how can i make C# writeline change color every second
Does the text change at all, or just the color?
79 replies
CC#
Created by krazycay on 4/19/2023 in #help
❔ how can i make C# writeline change color every second
Ah I see.
79 replies
CC#
Created by krazycay on 4/19/2023 in #help
❔ how can i make C# writeline change color every second
using System;
using System.Threading;

class Program
{
static void Main()
{
string text = "Hello World!";
while (true)
{
Console.SetCursorPosition(0, Console.CursorTop);
Console.ForegroundColor = GetRandomConsoleColor();
Console.Write(text);
Thread.Sleep(1000);
}
}

static ConsoleColor GetRandomConsoleColor()
{
var consoleColors = Enum.GetValues(typeof(ConsoleColor));
return (ConsoleColor)consoleColors.GetValue(new Random().Next(consoleColors.Length));
}
}
using System;
using System.Threading;

class Program
{
static void Main()
{
string text = "Hello World!";
while (true)
{
Console.SetCursorPosition(0, Console.CursorTop);
Console.ForegroundColor = GetRandomConsoleColor();
Console.Write(text);
Thread.Sleep(1000);
}
}

static ConsoleColor GetRandomConsoleColor()
{
var consoleColors = Enum.GetValues(typeof(ConsoleColor));
return (ConsoleColor)consoleColors.GetValue(new Random().Next(consoleColors.Length));
}
}
79 replies