Create a function
christmas_tree(height) (in Ruby) that returns a Christmas tree of the correct height
christmas_tree(height) should return:
Height passed is always an integer between 0 and 100.
Use \n for newlines between each line.
Pad with spaces so each line is the same length. The last line having only stars, no spaces.
This challenge comes from user8062788 on CodeWars. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!
Want to propose a challenge idea for a future post? Email firstname.lastname@example.org with your suggestions!
Top comments (4)
Forgot to post my soution from yesterday, also in Python: