*
**
***
****
I want to make this figure to be printed then disappear then printed again as if its moving horizontally once & vertically once & along the diagonal once
by using c++
#include "iostream"
#include <string>
#include <Windows.h>
usingnamespace std;
int main()
{
string down = "\n";
string across = " ";
cout << "*"<<endl;
cout << "**" << endl;
cout << "***";// Only 3 lines, but you get the idea
for (int x = 0; x < 21; x++)
{
Sleep(700);
system("cls");//Using System calls not good idea
cout << down<<across<<"*" << endl;
cout << across << "**" << endl;
cout << across << "***";
across += " ";
down += "\n";
}
return 0;
}