>I am using Microsofts Visual C++
Visual C++ doesn't support delay(), clrscr(), textcolor(), or randomize(). LIGHTGREEN is prototyped as a function yet I don't see it defined anywhere. This may work a little bit better:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <conio.h>
void delay ( int milli )
{
clock_t end, cur = clock();
for ( end = cur + milli; cur < end; cur = clock() );
}
void showwhirl(void)
{
int i, j;
char whirl[] = {'|','/','-','\\'};
for (i=0;i<=2; i++)
{
for (j=0; j<=3; j++)
{
printf("%c", whirl[j]);
delay(100);
printf("\b");
}
}
}
void printline(char line[])
{
showwhirl();
printf("%s\n", line);
}
int main(void)
{
int i;
HANDLE STDOUT;
srand ( time ( NULL ) );
STDOUT = GetStdHandle ( STD_OUTPUT_HANDLE );
SetConsoleTextAttribute ( STDOUT, FOREGROUND_GREEN );
while (!kbhit())
{
for(i=1; i<=40; i++)
{
cprintf("%c ", 49 + rand()%156);
}
delay(rand()%250);
}
printline("Programmed By Maharshi Akilla");
printline("http://mahurshi.tripod.com");
getch();
return 0;
}
-Prelude