Backup proyecto Joyfe - Borland
This commit is contained in:
63
CPP/PROG8.CPP
Normal file
63
CPP/PROG8.CPP
Normal file
@ -0,0 +1,63 @@
|
||||
// Prog8
|
||||
//
|
||||
// Programadores:
|
||||
//
|
||||
// Juan L<>pez Fern<72>ndez
|
||||
// Mois<69>s Virumbrales Cuenca
|
||||
// DAI 1<>A
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
char direccion;
|
||||
char caracter;
|
||||
int pos_x,pos_y,con;
|
||||
|
||||
void main()
|
||||
{
|
||||
clrscr();
|
||||
gotoxy (20,11);
|
||||
printf ("Introduzca el car<61>cter a imprimir: ");
|
||||
fflush (stdin);
|
||||
cscanf ("%c", &caracter);
|
||||
clrscr();
|
||||
direccion='d';
|
||||
pos_x=1;
|
||||
pos_y=1;
|
||||
for (;pos_y<=24;pos_y++)
|
||||
{
|
||||
for (con=1;con<=80;con++)
|
||||
{
|
||||
if (direccion=='d')
|
||||
{
|
||||
gotoxy(pos_x,pos_y);
|
||||
printf ("%c",caracter);
|
||||
pos_x++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gotoxy(pos_x,pos_y);
|
||||
printf ("%c",caracter);
|
||||
pos_x--;
|
||||
}
|
||||
if (con==40)
|
||||
{
|
||||
getch();
|
||||
}
|
||||
}
|
||||
getch();
|
||||
if (direccion=='d')
|
||||
{
|
||||
direccion='i';
|
||||
pos_x--;
|
||||
}
|
||||
else
|
||||
{
|
||||
direccion='d';
|
||||
pos_x++;
|
||||
}
|
||||
}
|
||||
gotoxy(1,25);
|
||||
printf ("Pulse una tecla para finalizar...");
|
||||
getch();
|
||||
}
|
||||
Reference in New Issue
Block a user