2629881

Untitled

Jul 25th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. static void Main(string[] args)
  2.         {
  3.             while (true)
  4.             {
  5.                 for (int i = 0; i < 20; i++)
  6.                 {
  7.                     WriteTextInPosition("a moving line", i);
  8.                 }                
  9.                 Thread.Sleep(250);
  10.                
  11.             }              
  12.         }
  13.        
  14.         public static void WriteTextInPosition(string text, int bot)
  15.         {
  16.                 Console.Clear();
  17.                 for (int i = 1; i <= bot; i++)
  18.                 {
  19.                     Console.WriteLine();
  20.                 }
  21.                 Console.WriteLine(String.Format("{0," + ((Console.WindowWidth / 2) + (text.Length / 2)) + "}", text));
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment