63 lines
969 B
C++
63 lines
969 B
C++
// Prog8
|
||
//
|
||
// Programadores:
|
||
//
|
||
// Juan L¢pez Fern ndez
|
||
// Mois‚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 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();
|
||
} |