well I got some what of an idea but my inner if statement does not increment back up.
Code:
#include <cstdlib>
#include <iostream>
using namespace std;
int design(int);
int main(int argc, char *argv[])
{
design(4);
system("PAUSE");
return EXIT_SUCCESS;
}
int design(int x)
{
int i;
int j = 3;
for(i =0; i < x; i++) //run until x = 0
{
cout << "*";
}
cout << endl;
if(x == 0)
{
for(i = 0; i <= x; i++) // run until x = 4
{
cout << "*";
}
cout << endl;
if(x == 4)
{
return 1;
}
else
{
design(x + 1); // here my x does not add to one
}
}
else
{
design(x - 1);
}