Advertisement
rakoczyn

Minutnik

Oct 20th, 2011
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace minutnik
  6. {
  7.     class Program
  8.     {
  9.  
  10.         static void minute(ConsoleColor Color, int t)
  11.         {
  12.             Console.BackgroundColor = Color;
  13.             for (int i = t; i > 0; i--)
  14.             {
  15.                 if (i <= 10)
  16.                 {
  17.                     Console.ForegroundColor = ConsoleColor.Red;
  18.                 }
  19.                 if (i <= 3)
  20.                 {
  21.                     Console.Beep();
  22.                 }
  23.                 Console.WriteLine("Pozostało {0} sek.", i);
  24.                 System.Threading.Thread.Sleep(1000);
  25.  
  26.                 Console.Clear();
  27.  
  28.             }
  29.           for (int i = 0; i<3;i++)  Console.Beep(3000,200);
  30.         }
  31.  
  32.         static void minute(ConsoleColor Color)
  33.         {
  34.             minute(Color, 60);
  35.         }
  36.  
  37.         static void minute(int t)
  38.         {
  39.             minute(ConsoleColor.Black, t);
  40.         }
  41.  
  42.         static void minute()
  43.         {
  44.             minute(ConsoleColor.Black, 60);
  45.         }
  46.  
  47.  
  48.         static void Main(string[] args)
  49.         {
  50.             minute();
  51.             minute(120);
  52.             minute(ConsoleColor.Blue);
  53.             minute(ConsoleColor.Blue, 120);
  54.  
  55.            
  56.  
  57.            
  58.  
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement