New answers tagged

4

Haskell (GHC 8.4.1, -cpp), score 28 This is the initial triangle (the first line is actually a space). q\ =p\ rint p=pu\ tStr;\ f(x:y)\ |length\ y>25=p"\ f ">>q('.\ '<$y);f s=\ p$show s++"\ ]\n";l=putSt\ rLn;main= do l. concat<>map\ M_((>>p",\\\10"\ ).p.show)$init[ \ " \nq\\\n=p\\\n",\ "rint\np=pu\\\nt",\ "Str;\\\nf(x:y)\\",\...


5

Zsh, score 5 The pattern repeats like this: # h\ ea\ d -\ n-1 \ $0 ### ####### ######## ######### ########## ########### ############ ############# # ad infinitum Try it online! With this as the ultimate program: # h\ ea\ d -\ n-1 \ $0 ### #: comments, ignored h\ea\d -\n-1 \$0: the backslashes and line breaks are eaten up to produce head -n-1 $0 head: ...


6

R, 278 lines The output of this 279-byte program: '->w;s=substring;`+`=paste0;x=nchar(w);y=s(w,1,138);z=sQuote(s(w,1,x-1))+y;for(i in 2:nchar(z)-2)cat("#"+s(z,1,i),sep=intToUtf8(10));cat(z).'->w;s=substring;`+`=paste0;x=nchar(w);y=s(w,1,138);z=sQuote(s(w,1,x-1))+y;for(i in 2:nchar(z)-2)cat("#"+s(z,1,i),sep=intToUtf8(10));cat(z) ...


8

JavaScript (ES6), Score  10  9 Below is an example starting point with 15 lines. Bigger triangles are obtained by padding the end with 0's while preserving the final `). 0 f= _=> `0 ${`f= `+f}`. /*###*/ replace( /..\n.+$/ ,'`)'||`00 00000000000 000000000000 0000000000000 00000000000000 0000000000000`) which is eventually reduced to: 0 f= _=> `0 ${...


0

Python 3, 80 + 9839 = 9919 bytes for n in range(1,256):m=int(n**.5);s='+'*m;print(f">{s}[<{s}>-]<{'+'*(n-m**2)}") Try it online! Expanded: for n in range(1, 256): m = int(n ** 0.5); s = '+' * m; print(f">{s}[<{s}>-]<{'+'*(n - m**2)}") Process: try to do a square number amount of increments add the ...


Top 50 recent answers are included