Well,
If you have the algo that generates the half-pyramid already it's pretty easy to make a "mirror image" of it and output first the mirror image and then the actual pyramid that you have there. It's also easy do that (output both pyramids at the same time) with a little more efford in these for loops.
Also and advice, in order to get rid of the annoying uppercase/lowercase letter issue (in the cases where you don't want the input to be case-sensive as it's this one) you can use the following in order to convert the input value (whether it is lowercase or uppercase) to uppercase or lowercase depending on your needs
-
char pKey;
-
-
pKey = getch();
-
-
// your check or whatever
-
if ( toupper(pKey) == 'K' /* can be anything else */ )
-
}
-
// do stuff
-
}
-
also if you have while loops or anything else that repeats :p just to avoid continued calls to that function, if you don't change the value before the check do the following:
-
char pKey;
-
-
pKey = getch();
-
-
pKey = toupper(pKey) ;
-
// your check or whatever
-
while ( pKey == 'K' /* can be anything else */ )
-
}
-
// do stuff
-
}
-
hope this helped!