BrandonSpendlove

Josh's Dream Game Application

Nov 15th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.66 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Threading;
  7.  
  8. namespace ColorFlash
  9. {
  10.     class Program
  11.     {
  12.  
  13.         public static ConsoleColor red = ConsoleColor.Red;
  14.         public static ConsoleColor yellow = ConsoleColor.Yellow;
  15.         public static ConsoleColor gray = ConsoleColor.Gray;
  16.         public static ConsoleColor white = ConsoleColor.White;
  17.         public static ConsoleColor blue = ConsoleColor.Blue;
  18.         public static ConsoleColor green = ConsoleColor.Green;
  19.         public static string textSpace = "                                                                                ";
  20.         static void Main(string[] args)
  21.         {
  22.             colorLoop();
  23.             Console.ReadLine();
  24.         }
  25.  
  26.         static void colorLoop()
  27.         {
  28.             while (true)
  29.             {
  30.                 Console.BackgroundColor = red;
  31.                 Console.WriteLine(textSpace);
  32.                 Thread.Sleep(5);
  33.                 Console.BackgroundColor = yellow;
  34.                 Console.WriteLine(textSpace);
  35.                 Thread.Sleep(5);
  36.                 Console.BackgroundColor = gray;
  37.                 Console.WriteLine(textSpace);
  38.                 Thread.Sleep(5);
  39.                 Console.BackgroundColor = white;
  40.                 Console.WriteLine(textSpace);
  41.                 Thread.Sleep(5);
  42.                 Console.BackgroundColor = blue;
  43.                 Console.WriteLine(textSpace);
  44.                 Thread.Sleep(5);
  45.                 Console.BackgroundColor = green;
  46.                 Console.WriteLine(textSpace);
  47.             }
  48.         }
  49.  
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment