Backup proyecto Joyfe - Borland

This commit is contained in:
2025-06-16 22:54:10 +02:00
commit d61829a1a7
130 changed files with 11881 additions and 0 deletions

124
CPP/PROG7.CPP Normal file
View File

@ -0,0 +1,124 @@
// Prog7
//
// Programadores:
//
// Juan L<>pez Fern<72>ndez
// Mois<69>s Virumbrales Cuenca
// DAI 1<>A
//
// Pinta una espiral con el caracter introducido y pinta sus diagonales.
#include <stdio.h>
#include <conio.h>
char direccion;
char caracter;
int pos_x,pos_y,avanza,con,veces,avanzamas,sw;
void main()
{
clrscr();
gotoxy (20,11);
printf ("Introduzca el car<61>cter a imprimir: ");
fflush (stdin);
cscanf ("%c", &caracter);
//gotoxy (20,12);
//printf ("Introduzca el sentido inicial: ");
//fflush(stdin);
//scanf("%c",&direccion_inicial);
clrscr();
direccion='e';
pos_x=40;
pos_y=12;
avanza=1;
//avanzamas=15;
gotoxy (pos_x,pos_y);
printf ("%c",caracter);
do
{
for (con=1;con<=2;con++)
{
for (veces=1;direccion=='e' && veces<=avanza;veces++)
{
gotoxy(pos_x,pos_y);
printf("%c",caracter);
pos_x++;
if (pos_x==50)
{
sw=1;
direccion='p';
}
}
for (veces=1;direccion=='o' && veces<=avanza;veces++)
{
gotoxy(pos_x,pos_y);
printf("%c",caracter);
pos_x--;
}
for (veces=1;direccion=='n' && veces<=avanza;veces++)
{
gotoxy(pos_x,pos_y);
printf("%c",caracter);
pos_y--;
}
for (veces=1;direccion=='s' && veces<=avanza;veces++)
{
gotoxy(pos_x,pos_y);
printf("%c",caracter);
pos_y++;
}
getch();
// Cambio de direcciones.
if (direccion=='e')
{
direccion='s';
}
else
{
if (direccion=='o')
{
direccion='n';
}
else
{
if (direccion=='n')
{
direccion='e';
}
else
{
if (direccion=='s')
{
direccion='o';
}
}
}
}
}
//avanzamas++;
avanza++;
}
while (sw==0);
gotoxy(80,25);
getch();
pos_x=31;
pos_y=3;
for(con=1;con<=19;con++,pos_x++,pos_y++)
{
gotoxy (pos_x,pos_y);
textcolor(14);
cprintf ("%c",caracter);
}
getch();
pos_x=49;
pos_y=3;
for(con=1;con<=19;con++,pos_x--,pos_y++)
{
if (pos_x!=40)
{
gotoxy (pos_x,pos_y);
textcolor(1);
cprintf ("%c",caracter);
}
}
getch();
}