Skip to content

Instantly share code, notes, and snippets.

@jakejscott
Created August 1, 2012 15:09
Show Gist options
  • Save jakejscott/3227654 to your computer and use it in GitHub Desktop.
Save jakejscott/3227654 to your computer and use it in GitHub Desktop.
Console spinner
public class ConsoleSpiner
{
int counter;
public ConsoleSpiner()
{
counter = 0;
}
public void Turn()
{
counter++;
switch (counter % 4)
{
case 0: Console.Write("/"); break;
case 1: Console.Write("-"); break;
case 2: Console.Write("\\"); break;
case 3: Console.Write("-"); break;
}
Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);
}
}
static void Main(string[] args)
{
ConsoleSpiner spin = new ConsoleSpiner();
Console.Write("Working....");
while (true)
{
spin.Turn();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment