About animation

Hello guys. I've just registered to this forum. And I need a bit of help, or at least some knowledge.

I want to make simple (in fact the most simple) animation that doesn't involve graphics.h. I want to make an asterisk (*) to circle (actually to square) around the program window using a while loop. It's for a school project.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <dos.h>
#include <iostream.h>
#include <constrea.h>
#include <stdio.h>
int main()
{   
    int x=5, y=4; 
    clrscr();
    while (x>0, y>0)
    {
         gotoxy(x,y);
         cout<<"*";
         delay(300);
         x+=1;
         if (x==20)
         {  
            x+=0;
            y+=1;
         }
     }
}


This is a part of my school project. And this is the output that I didn't expect:


********************
                    ************************************************************

N.B.: There is only one asterisk moving, but I typed all the asterisk to show its path.

My desired output:


********************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*                                                                              *
*                                                                              *
*                                                                              *
*                                                                              *
********************************************************************************


Again, there is only one asterisk moving. I want it to square around the program window. But how? If my work is incomplete, please help me. Thanks in advance.
It moves over until x is 20, then also moves down. The next iteration, x is incremented against to 21 and this continues, moving the asterisk further to the right.
Thanks for your reply. I appreciate it, and it seems I'm getting through all this. Thanks.
Topic archived. No new replies allowed.