# Loops in a Pyramid problem

• November 5th, 2012, 09:15 AM
BeyondInvisible
Loops in a Pyramid problem
Hello everyone,

Eventhough this is my first post, I've been reading, and browsing this forum a lot. I have a problem figuring out how to draw a pyramid as follow (minus the *s)

********A
******A*B*A
****A*B*B*B*A
**A*B*B*B*B*B*A
A*B*B*B*B*B*B*B*A
The problem is that it has A, B and a space between them.

I was thinking of drawing two separate pyramid, as follow:

********A
******A***A
****A*******A
**A***********A
A***************A
And another one:

********B
******B*B*B
****B*B*B*B*B
**B*B*B*B*B*B*B

However, I really appreciate all your input/help on this. I seem to have a hard time finding a good mathematic equation for the "for loops"

• November 5th, 2012, 09:33 AM
KevinWorkman
Re: Loops in a Pyramid problem
You aren't really going to be able to draw them separately.

I'd start out by drawing a pyramid with a single character, then taking care of the special cases after you have that working.
• November 7th, 2012, 09:10 AM
BeyondInvisible
Re: Loops in a Pyramid problem
Quote:

Originally Posted by KevinWorkman
You aren't really going to be able to draw them separately.

I'd start out by drawing a pyramid with a single character, then taking care of the special cases after you have that working.