Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Threading;
- namespace ColorFlash
- {
- class Program
- {
- public static ConsoleColor red = ConsoleColor.Red;
- public static ConsoleColor yellow = ConsoleColor.Yellow;
- public static ConsoleColor gray = ConsoleColor.Gray;
- public static ConsoleColor white = ConsoleColor.White;
- public static ConsoleColor blue = ConsoleColor.Blue;
- public static ConsoleColor green = ConsoleColor.Green;
- public static string textSpace = " ";
- static void Main(string[] args)
- {
- colorLoop();
- Console.ReadLine();
- }
- static void colorLoop()
- {
- while (true)
- {
- Console.BackgroundColor = red;
- Console.WriteLine(textSpace);
- Thread.Sleep(5);
- Console.BackgroundColor = yellow;
- Console.WriteLine(textSpace);
- Thread.Sleep(5);
- Console.BackgroundColor = gray;
- Console.WriteLine(textSpace);
- Thread.Sleep(5);
- Console.BackgroundColor = white;
- Console.WriteLine(textSpace);
- Thread.Sleep(5);
- Console.BackgroundColor = blue;
- Console.WriteLine(textSpace);
- Thread.Sleep(5);
- Console.BackgroundColor = green;
- Console.WriteLine(textSpace);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment