15357
Companion Cube
- Joined
- Jan 11, 2005
- Messages
- 15,209
- Reaction score
- 23
Hey guys.
Ok, I'm working on a C problem for a few hours now, and I can't seem to be able to work this one out. I never knew I sucked this much at C. :/
Basically, what I'm trying to do is to make it rain * randomly and pile up as they hit the ground.
Example:
You understand, right? The asterisks have to fall down and pile up in order after they hit the "ground" or another asterisk that fell earlier.
I've been trying to do this by using
(well Kind of, just an example)
and system("cls"); to clear the screen after each loop.
The professor suggested using SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
and a set of COORD variables, but that didn't help much.
Any suggestions? I'll prolly get this working sooner or later, but I could really use the help.
Ok, I'm working on a C problem for a few hours now, and I can't seem to be able to work this one out. I never knew I sucked this much at C. :/
Basically, what I'm trying to do is to make it rain * randomly and pile up as they hit the ground.
Example:
Code:
*
Code:
*
*
Code:
*
*
*
Code:
*
*
*
*
Code:
*
*
*
* *
Code:
*
*
*
* * *
You understand, right? The asterisks have to fall down and pile up in order after they hit the "ground" or another asterisk that fell earlier.
I've been trying to do this by using
Code:
for (i = 0; i < 400; i++){
b++;
if (hor[i] == 1){
printf("*");
}
else if (b == 41){
printf("\n");
b = 1;
}
else
printf(" ");
}
(well Kind of, just an example)
and system("cls"); to clear the screen after each loop.
The professor suggested using SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
and a set of COORD variables, but that didn't help much.
Any suggestions? I'll prolly get this working sooner or later, but I could really use the help.