Problem
Inspired by a previous challenge doing something similar
Given positive integer input n
output a shape that follows this pattern:
input n=1
:
* *
*
* *
input n=2
:
** **
****
**
****
** **
input n=3
:
*** ***
*** ***
*****
***
*****
*** ***
*** ***
and so on...
It has these properties:
n*2+1
lines tall
the "arms" are n
wide except when they merge
the center line is n
wide
if n
is even the lines above and below the center are n*2
wide
if n
is odd the lines above and below the center are n*2-1
wide
Rules
- Trailing newlines accepted
- Standard loopholes apply
- Shortest bytes win
- Output may be print out or a string or array of strings
Edits
n=0
doesn't need to be handled- Trailing spaces allowed
1
instead of*
and0
instead of space? \$\endgroup\$