Uses
Crt;
Var
Opc:char;
msg:string='Programa creado por Alison';
Procedure Centrar(Texto:String; fila:Integer);
Var
Columna:integer;
Begin
Columna:=(80-Length(Texto)) DIV 2;
Gotoxy(Columna,fila);
Write(Texto);
end;
Procedure numeracion1;
Var
x:integer;
Begin
Clrscr;
For x:=1 to 100 do
Begin
Write(' ',x);
end;
readkey;
end;
Procedure numeracion2;
Var
x:integer;
Begin
Clrscr;
For x:=100 downto 1 do
Begin
Write(' ',x);
end;
readkey;
end;
Procedure numeracion3;
Var
x,y:integer;
Begin
Clrscr;
y:=0;
For x:=0 to 100 do
Begin
Write(' ',y);
y:=y+2;
end;
readkey;
end;
Procedure numeracion4;
Var
x,y:integer;
Begin
Clrscr;
y:=1;
For x:=1 to 100 do
Begin
Write(' ',x);
y:=y+2;
end;
readkey;
end;
Procedure Salida;
Begin
Clrscr;
Textbackground(red);
Textcolor(yellow);
Centrar('Gracias por usarme, hasta luego',8);
Delay(2000);
end;
{EMPIEZA PROGRAMA PRINCIPAL}
Begin
Repeat
Clrscr;
Gotoxy(24,1);
Writeln('+---------------------------------------+');
Gotoxy(24,2);
Writeln('| |');
Gotoxy(24,3);
Writeln('+---------------------------------------+');
Gotoxy(28,2);
Textcolor(yellow);
textbackground(red);
Writeln(msg);
Textcolor(white);
Textbackground(black);
Gotoxy(12,5);
Writeln('+------------------------------------------------------+');
Gotoxy(12,6);
Writeln('| |');
Gotoxy(12,7);
Writeln('| |');
Gotoxy(12,8);
Writeln('| |');
Gotoxy(12,9);
Writeln('| |');
Gotoxy(12,10);
Writeln('| |');
Gotoxy(12,11);
Writeln('| |');
Gotoxy(12,12);
Writeln('| |');
Gotoxy(12,13);
Writeln('| |');
Gotoxy(12,14);
Writeln('| |');
Gotoxy(12,15);
Writeln('| |');
Gotoxy(12,16);
Writeln('| |');
Gotoxy(12,17);
Writeln('+------------------------------------------------------+');
Centrar('OPCIONES DEL PROGRAMA',6);
Centrar('[A]Numeracion del 1 al 100',8);
Centrar('[B]Numeracion del 100 al 1',10);
Centrar('[C]Numeracion Pares',12);
Centrar('[D]Numeracion Impares',14);
Centrar('[X] SALIR DEL PROGRAMA',16);
Textcolor(green);
Centrar('Elige una opcion',18);
Opc:=readkey;
Case opc of
'A','a': Numeracion1;
'B','b': Numeracion2;
'C','c': Numeracion3;
'D','d': Numeracion4;
'X','x': salida;
end;
Until (opc='x') or (opc='X');
End.
No hay comentarios:
Publicar un comentario