Program numeraciones;
Uses
Crt;
Var
Opc:char;
msg:string=’Programa elaborado por martin martinez’;
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 50 do
Begin
Write(’ ‘,y);
y:=y+2;
End;
Readkey;
End;
Procedure Numeracion4;
Var
x,y:integer;
Begin
Clrscr;
y:=1;
For x:=1 to 50 do
Begin
Write(’ ‘,y);
y:=y+2;
End;
Readkey;
End;
Procedure Salida;
Begin
Clrscr;
Textbackground(red);
Textcolor(white);
Centrar(‘Gracias por usar este programa’,8);
Delay(2000);
End;
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(8,5);
Writeln(‘+—————————————————————————-+’);
Gotoxy(8,6);
Writeln(‘| |’);
Gotoxy(8,7);
Writeln(‘| |’);
Gotoxy(8,8);
Writeln(‘| |’);
Gotoxy(8,9);
Writeln(‘| |’);
Gotoxy(8,10);
Writeln(‘| |’);
Gotoxy(8,11);
Writeln(‘| |’);
Gotoxy(8,12);
Writeln(‘| |’);
Gotoxy(8,13);
Writeln(‘| |’);
Gotoxy(8,14);
Writeln(‘| |’);
Gotoxy(8,15);
Writeln(‘| |’);
Gotoxy(8,16);
Writeln(‘| |’);
Gotoxy(8,17);
Writeln(‘| |’);
Gotoxy(8,18);
Writeln(‘+—————————————————————————-+’);
Centrar(‘Opciones del programa’,6);
Centrar(‘[N]umeracion de menor a mayor’,8);
Centrar(‘N[u]meracion de mayor a menor’,10);
Centrar(‘Nu[M]eracion de dos en dos’,12);
Centrar(‘Num[E]racion de tres en tres’,14);
Centrar(‘[X] SALIR DEL PROGRAMA’,16);
Textcolor(green);
Centrar(‘Elige una opcion’,17);
Opc:=readkey;
Case opc of
‘N’,’n’: Numeracion1;
‘U’,’u’: Numeracion2;
‘M’,’m’: Numeracion3;
‘E’,’e’: Numeracion4;
‘X’,’x’: salida;
End;
Until (opc=’x’) or (opc=’X’);
End.
No hay comentarios:
Publicar un comentario