the image is structured in the following way:
Y01
Y11
---------
Y02
Y12
---------
Y04
Y14
---------
Y08
Y18
---------
Y016
Y116
Y0x & Y1x for the letter Y: Y0x are the branches and Y1x is the trunc; x is the number if lines required to form the letter
E.g. Y02 & Y12 - 2 lines to form the branches and 2 line to form the trunk
1---1
1-1
1
1
You can notice that there is one more 'rule': when you start drawing the new letters (e.g. you go from Yx2 to Yx3) you copy the last line.
EDIT:
Let's assume you have the drawing saved in a matrix char P[63][100]
I would write 2 function (not the optimal approach but you can optimize it)
- drawY - draws the Y letters according to inputs
- drawPicutre - draws the "layers" of Y
drawY(int startPos, int stopPos, int*line, int lvl, int count)
{
if(lvl>=count)
{
P[*line][(startPos+(stopPos-startPos))/2] = '1';
P[*line + lvl][(startPos+(stopPos-startPos))/2 +count] = '1';
P[*line + lvl][(startPos+(stopPos-startPos))/2 -count] = '1';
(*line)--;
drawY(startPos,stopPos,line,lvl,count+1);
}
}
int line=63;
drawY(0,100, &line, 16, 1); // draws the first, and largest Y
You just need to implement the second function, drawPicture(...) which calls drawY. You can modify drawY if you want to.