I assume you are requesting a 2d ASCII representational filling of an equilateral triangle using an incremental basic Latin ascended alphabetical array.
Array("a","b","c"...)
First we need to determine the parameters of the 'pyramid'
I will use 25 x 13.
I will also assume you want to draw down from the top.
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][A][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][A][B][A][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][A][B][C][D][E][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][A][B][C][D][E][F][G][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][A][B][C][D][E][F][G][H][I][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][A][B][C][D][E][F][G][H][I][J][K][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][A][B][C][D][E][F][G][H][I][J][K][L][M][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][A][B][C][D][E][F][G][H][I][J][K][L][M][N][O][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][A][B][C][D][E][F][G][H][I][J][K][L][M][N][O][P][Q][ ][ ][ ][ ]
[ ][ ][ ][A][B][C][D][E][F][G][H][I][J][K][L][M][N][O][P][Q][R][S][ ][ ][ ]
[ ][ ][A][B][C][D][E][F][G][H][I][J][K][L][M][N][O][P][Q][R][S][T][U][ ][ ]
[ ][A][B][C][D][E][F][G][H][I][J][K][L][M][N][O][P][Q][R][S][T][U][V][W][ ]
[A][B][C][D][E][F][G][H][I][J][K][L][M][N][O][P][Q][R][S][T][U][V][W][X][Y]
Notice the [ ]
these will need to be empty spaces for design purposes.
int main(void){
unsigned short int dimensions[2] = [25, 13];
unsigned short int n_characters = 1;
for(unsigned short int row=0; row <= dimensions[1]-1; row++){
printf("%c", alpha_string(n_characters);
n_characters += 2;
}
return 0;
}
char* alpha_string(unsigned short int n_characters, unsigned short int width){
char label[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char ret[n_characters];
for (unsigned short int i= 0; i<= width-n_characters; i++){
ret[i] = " ";
}
for (unsigned short int i= 0; i<= n_characters; i++){
ret[i] = label[i];
}
return ret;
}
Consider this pseudo code, i free handed this without error checks.