Advertisement
ozakisama

ConsoleSpiner [Class] by Bautista

Jul 2nd, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleSpiner
  7. {
  8.     class ConsoleSpiner
  9.     {
  10.         int counter;
  11.         public ConsoleSpiner()
  12.         {
  13.             counter = 0;
  14.         }
  15.         public void Turn()
  16.         {
  17.             counter++;
  18.             switch (counter % 4)
  19.             {
  20.                 case 0: Console.Write("/"); break;
  21.                 case 1: Console.Write("-"); break;
  22.                 case 2: Console.Write("\\"); break;
  23.                 case 3: Console.Write("-"); break;
  24.             }
  25.             Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);
  26.         }
  27.  
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement