Simpler version of this
Task
You must create a program that outputs a triangle of a given size N.
- A triangle is made of 3 identical triangles
- A triangle of size N should be made of N lines
- A triangle's line starts from 1 star, and increases by 2 stars each line
Test Cases:
1 ->
*
* *
3 ->
*
***
*****
* *
*** ***
***** *****
5 ->
*
***
*****
*******
*********
* *
*** ***
***** *****
******* *******
********* *********
10 ->
*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
* *
*** ***
***** *****
******* *******
********* *********
*********** ***********
************* *************
*************** ***************
***************** *****************
******************* *******************
Scoring:
This is code-golf so shortest code size wins!
Trailing whitespace is allowed
Credits to Ninsuo for the puzzle
*
to create the triangles? And any reason why the input is always a triangular number (which 5 isn't as mentioned by @Giuseppe), since any positive integer works for the intended output? \$\endgroup\$