programa de un semáforo de caracteres de verdad
int i = 0,c=0;
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
System.Threading.Thread.Sleep(1000);
Console.Clear();
do
{
i++;
c++;
if (c == 1)
{
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.ForegroundColor = ConsoleColor.Green;
Console.Beep();
Console.Write("*");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
System.Threading.Thread.Sleep(2500);
}
if (c == 2)
{
Console.Clear();
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Beep();
Console.Write("*");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
System.Threading.Thread.Sleep(500);
Console.Clear();
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.Write(" ");
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.Write(" ");
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
Console.Clear();
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.Write(" ");
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Beep();
Console.Write("*");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
System.Threading.Thread.Sleep(500);
Console.Clear();
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.Write(" ");
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.Write(" ");
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
System.Threading.Thread.Sleep(500);
Console.Clear();
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.Write(" ");
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Beep();
Console.Write("*");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
System.Threading.Thread.Sleep(500);
Console.Clear();
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.Write(" ");
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.Write(" ");
Console.WriteLine(" |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
System.Threading.Thread.Sleep(500);
}
if (c == 3)
{
Console.Clear();
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.WriteLine(" | |");
Console.WriteLine(" |___|");
Console.WriteLine(" ┌---┐");
Console.Write(" | ");
Console.ForegroundColor = ConsoleColor.Red;
Console.Beep();
Console.Write("*");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(" |");
Console.WriteLine(" |___|");
System.Threading.Thread.Sleep(2500);
}
if (c == 4)
{
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine(" Universidad Autonoma de Coahuila");
}
if (c == 5)
Console.Write("");
if (c == 6) c = 0;
System.Threading.Thread.Sleep(1000);
if (i == 6) break;
} while (true) ;
Console.Clear();
No hay comentarios.:
Publicar un comentario