Advertisement
csaki

keringő csillag

Oct 10th, 2012
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6.  
  7. namespace @for
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             while (true)
  14.             {
  15.                 Console.Clear();
  16.                 Random rand = new Random();
  17.  
  18.                 #region első for ciklus
  19.                 for (int i = 0; i < 10; i++)
  20.                 {
  21.                     Console.Clear();
  22.                     Console.SetCursorPosition(i, 0);
  23.                     Console.Write('*');
  24.                     Thread.Sleep(40);
  25.                 }
  26.                 #endregion
  27.  
  28.                 #region második for ciklus
  29.                 for (int i = 0; i < 6; i++)
  30.                 {
  31.                     Console.Clear();
  32.                     Console.SetCursorPosition(10, i);
  33.                     Console.Write('*');
  34.                     Thread.Sleep(40);
  35.                 }
  36.                 #endregion
  37.  
  38.                 #region harmadik for ciklus
  39.                 for (int i = 10; i > 0; i--)
  40.                 {
  41.                     Console.Clear();
  42.                     Console.SetCursorPosition(i, 6);
  43.                     Console.Write('*');
  44.                     Thread.Sleep(40);
  45.                 }
  46.                 #endregion
  47.  
  48.                 #region negyedik for ciklus
  49.                 for (int i = 6; i > 0; i--)
  50.                 {
  51.                     Console.Clear();
  52.                     Console.SetCursorPosition(0, i);
  53.                     Console.Write('*');
  54.                     Thread.Sleep(40);
  55.                 }
  56.                 #endregion
  57.  
  58.             }
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement