countdown();

Im trying to create a countdown function after I drew the numbers using DrawLine from 9 to 0. The numbers are all on the same location on form1. I want them to disapear as they are being counteddown.

Any suggestions??

Thanks.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<iostream>
using namespace std;

void delay(int seconds)
{
     time_t endwait;
     endwait = clock() + seconds * CLOCKS_PER_SEC;
     while(clock()<endwait){}
     }

int main()
{
          for(int i=9;i>=0;i--)
          {
              cout << i;
              delay(1);
              cout << "\b";
              }
              cout << "\b";
    }
MY PROJECT WAS CREATED UNDER THE WINDOWS FORM APPLICATION.
HERE'S MY CODE:

void drawHorizontal(int column, int row, int length)
{
Graphics^ dNumber = this->CreateGraphics();
Pen^ pNumber = gcnew Pen (Color::Yellow);
dNumber-> DrawLine (pNumber, column, row, column+length, row );
}

void drawVertical(int column, int row, int length)
{
Graphics^ dNumber = this->CreateGraphics();
Pen^ pNumber = gcnew Pen (Color::Yellow);
dNumber-> DrawLine (pNumber, column, row, column, row+length );
}

void filipesDraws0 ()
{
drawVertical (300, 50, 80);
drawVertical (301, 50, 80);
drawVertical (302, 50, 80);
drawHorizontal (300, 50, 40);
drawHorizontal (300, 51, 40);
drawHorizontal (300, 52, 40);
drawVertical (340, 50, 80);
drawVertical (341, 50, 80);
drawVertical (342, 50, 80);
drawHorizontal (300, 130, 40);
drawHorizontal (300, 131, 40);
drawHorizontal (300, 132, 40);
}

that's how i drew my zero, all the other numbers were drawn on the same location, above the zero. i want the to disapear as a countdown.

Any help please?
What's with the ^ ? Is Pascal haunting me?
As for the problem, you're using some graphics library. That library most likely has some reference. You should find that reference and look for something about clearing the screen. I really can't help you.
Topic archived. No new replies allowed.