Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var random = new Random();
- int wielkosc = 6;
- for (; ; )//nieskonczona petla
- {
- for (int i = 1; i <= wielkosc; ++i)//petla wypisująca górną warstwę
- {
- Console.ForegroundColor = (ConsoleColor)random.Next((int)ConsoleColor.White);
- Console.Write("*");
- Console.WriteLine();
- System.Threading.Thread.Sleep(65);//ogranicznik czasowy
- for (int x = 1; x <= i; ++x)
- {
- Console.Write(" ");
- }
- }
- for (int i = wielkosc; i >= 1; --i)//petla wypisująca dolną warstwę
- {
- {
- Console.ForegroundColor = (ConsoleColor)random.Next((int)ConsoleColor.White);
- Console.Write("*");
- Console.WriteLine();
- System.Threading.Thread.Sleep(65);
- for (int c = i; c >= 1; --c)
- {
- Console.Write(" ");
- }
- }
- }
- Console.ReadKey(true);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement