(Extended/Inspired from Seb Rose's Diamond kata at http://cyber-dojo.org/ )
Given a number, print a diamond made up of asterisks (*)
The number passed to your function indicates the number of rows of stars to print until it reaches the widest point of the diamond.
For example:
printDiamond(3);
*
* *
* *
* *
*
printDiamond(4):
*
* *
* *
* *
* *
* *
*
printDiamond('E')
A
B B
C C
D D
E E
D D
C C
B B
A
printDiamond('C')
A
B B
C C
B B
A
printDiamond('F')
F
F E F
F E D E F
F E D C D E F
F E D C B C D E F
F E D C B A B C D E F
F E D C B C D E F
F E D C D E F
F E D E F
F E F
F
printDiamond('D')
A
B L
C K
D J
E I
F H
G