Question: ( C Program please ) To craft an ultimate sword, Kaela needs a thin slice of this crystal, but directly slicing such a rare gem
C Program please To craft an ultimate sword, Kaela needs a thin slice of this crystal, but directly slicing such a rare gem is a tough task
as jewels of emotions are known to be extremely fragile. To avoid damaging the crystal, Kaela asked you to write a program to visualize
the crosssection of the crystal at any given depth.
The crystal's crosssection at any depth forms a diamondshaped pattern. The outermost layer of the diamond is labeled with the letter
The subsequent inner layers are labeled B and so forth. After the labeling wraps around to again and continues.
Here is an animation showing the crosssection of the crystal with layers, varying
Note that there are spaces before and after the characters. You have to print them out too. For example, for and you must
print:
Input
The input consists of integers, and
: The total number of layers in the crystal.
: The depth of the crosssection
Output
The crosssection of the crystal at depth D The crosssection should consist of L lines with L characters on each line,
including spaces. The center of the crosssection should be located at the exact middle point of the Lth line. Also, all line has a newline
character : at the end.
Sample Input
Sample Output
A
ABA
ABCBA
ABA
A
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
