Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1.  
  2. var random = new Random();
  3. int wielkosc = 6;
  4.  
  5. for (; ; )//nieskonczona petla
  6. {
  7. for (int i = 1; i <= wielkosc; ++i)//petla wypisująca górną warstwę
  8. {
  9. Console.ForegroundColor = (ConsoleColor)random.Next((int)ConsoleColor.White);
  10. Console.Write("*");
  11. Console.WriteLine();
  12. System.Threading.Thread.Sleep(65);//ogranicznik czasowy
  13. for (int x = 1; x <= i; ++x)
  14. {
  15. Console.Write(" ");
  16. }
  17. }
  18.  
  19. for (int i = wielkosc; i >= 1; --i)//petla wypisująca dolną warstwę
  20. {
  21. {
  22. Console.ForegroundColor = (ConsoleColor)random.Next((int)ConsoleColor.White);
  23. Console.Write("*");
  24. Console.WriteLine();
  25. System.Threading.Thread.Sleep(65);
  26. for (int c = i; c >= 1; --c)
  27. {
  28. Console.Write(" ");
  29.  
  30. }
  31. }
  32. }
  33. Console.ReadKey(true);
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement