Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
#Haskell, 35 38 bytes ListList comprehension thanks to nimi:
f x=unlines[[1..n]>>"*"|n<-[1..x]]
Old version:
f 0="" f n=f(n-1)++([1..n]>>"*")++"\n"
Alternate version:
g n=([1..n]>>"*")++"\n" f n=[1..n]>>=g
#Haskell, 35 38 bytes List comprehension thanks to nimi:
List comprehension thanks to nimi:
#Haskell, 3835 38 bytes f 0="" f n=f(n-1)++([1..n]>>"*")++"\n"List comprehension thanks to nimi:
#Haskell, 38 bytes f 0="" f n=f(n-1)++([1..n]>>"*")++"\n"
#Haskell, 3738 bytes f 0="" f n=f(n-1)++([1..n]>>"*")++"\n"
#Haskell, 37 bytes f 0="" f n=f(n-1)++([1..n]>>"*")++"\n"