Given a number N
, how can I print out a Christmas tree of height N
using the least number of code characters? N
is assumed constrained to a minimum value of 3
, and a maximum value of 30
(bounds and error checking are not necessary). N
is given as the one and only command line argument to your program or script.
All languages appreciated, if you see a language already implemented and you can make it shorter, edit if possible - comment otherwise and hope someone cleans up the mess. Include newlines and White Spaces for clarity, but don't include them in the character count.
A Christmas tree is generated as such, with its "trunk" consisting of only a centered "*"
N = 3:
*
***
*****
*
N = 4:
*
***
*****
*******
*
N = 5:
*
***
*****
*******
*********
*
N defines the height of the branches not including the one line trunk.
Merry Christmas PPCG!