How do similar picture with two functions ???

I'm learn this language into 2 weeks and i don't understand how do this ...
someone can explain me ?


*
_*______
__ *____
___*____
___*____
__*____
_*____
*____
*____
_*____
__*___
___*___
1
2
3
4
5
6
7
8
9
10
11
12
13
std::cout << 
"*" <<
"_*______" <<
"__ *____" <<
"___*____" <<
"___*____" <<
"__*____" <<
"_*____" <<
"*____" <<
"*____" <<
"_*____" <<
"__*___" <<
"___*___" << std::endl;
You're missing a few newlines there.
I want to make this with two functions (only a star, the underscore not appear in output)
Here is my five cents.

1
2
3
4
5
6
7
8
9
int j = 1;
char s[] = "*______";
char *p = s;
for ( int i = 0; i  < 12; i++ )
{
	std::cout << s << std::endl;
	if ( i % 4 == 3 ) j = -j;
	else { std::swap( *p, *( p + j ) ); p += j; }
}
Topic archived. No new replies allowed.