Está en la página 1de 2

#include <stdio.

h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
#include <iostream>
#include <time.h>

using namespace std;

void gotoxy(int x, int y)


{
HANDLE hcon;
hcon = GetStdHandle(STD_OUTPUT_HANDLE);
COORD dwPos;
dwPos.X = x;
dwPos.Y = y;
SetConsoleCursorPosition(hcon,dwPos);
}

struct Caracter{
int nuX;
int nuY;
int stLetra;
};

main(){
int X;
X=700;
system("cls");
Caracter letra[100];
int cc,j=0;

//LLENA EL ARREGLO DE VALORES


for(int i=0;i<100;i++){
letra[i].stLetra=70+(rand()%26);
letra[i].nuX=(rand()%80)+1;
letra[i].nuY=j;
j=j-1;
}

cc=0;
int aux=0;

do{
system("cls");
for(int i=0;i<cc;i++){
gotoxy(letra[i].nuX,letra[i].nuY);
printf("%c",letra[i].stLetra);
}
cc+=1;
for(int i=0;i<100;i++){
letra[i].nuY+=1;
}
Sleep(X);

gotoxy(115,24);cout<<"-------------------------------------------------------------
---------------------";
}while(cc<=60);
system("cls");
system("PAUSE");
}

También podría gustarte