# [R], <s>270</s> <s>265</s> <s>252</s> <s>243</s> <s>232</s> <s>227</s> 225 bytes *I finally managed to remove 2 more characters to bring the total to a number that can be represented in triangular form (as shown here). Code should be formatted conventionally to be run (as in the example on TIO); the '•' represents a newline (```\n```) character.* <!-- language-all: lang-r --> f unc tion( s,`~`=c bind,m=ma trix){n=nch ar(s)+1;p=m(, n^2,2);while(T< n){a=4*F;p[T+0:a, ]=c(F:-F,(-F:F)[-1] )~0:a-2*F;p[T+a+-2:a+ 3,]=(F=F+1)~(b=2*F-1):- b;T=T+2*a+4};m=m(" ",n,n) ;m[p[2:n-1,]+b+1]=el(strspl it(s,''));apply(m,1,cat,"•")} [Try it online!][TIO-kezbft61] [R]: https://www.r-project.org/ [TIO-kezbft61]: https://tio.run/##NY/LboMwEEX3/gqLLrBjUxWaFaq3fAE7RBUDTnBrxtQ2eTRKfp06UrMb6Zy5utetwWkJB6PEul@gD9oC8Xx334m@0zDwSUwyKmd6BQH9KB3xlOVoFhPh8FnwgqLTqI0i9QfQqxTbTYXmpmZvpeSt6ElVZhUnWVVWtMnylt4jyIp/SbKsKCV7jyapRMVyeiediDTLaZl1qBY1KzaSbW8o9iAJTjhwoGhq5qYoIct5yzqWt0IZ4oPzs9Ehtk9TSpGcZ3MhE895LwNPUEJv6wsGGxQOowz4uRs/Z@NReuxUWBzgozTLv6f94wmDUoMaOPYW@2CdGrB@aDGkixkpLMakeFROoccpnukkCaP6WXT/3Tl7gr09fy3T7O1RuQiM/L0M9vCa0PUP "R – Try It Online" Note that this approach has been comprehensively outgolfed by [att's approach](https://codegolf.stackexchange.com/questions/210454/spiralize-a-word-triangularly/210543#210543), although as consolation neither that nor any of the other current answers can be represented as a triangle... Works by constructing the coordinates for each letter, then using this to put the letters into an empty matrix. Commented: ``` triangle= function(s){n=nchar(s) # n is the number of letters s=el(strsplit(s,'')) # first split the string into individual letters p=matrix(,2,n^2) # initialize p as a 2-row matrix to hold the coordinates # (with plenty of columns so that we've enough to go all # the way round the outermost triangle) # now, F is the current loop, starting at 0 while(T<=n){ # T is the current letter index a=4*F+1 # a=the size of the 'arch' (number of letters going up & over) p[,T+1:a-1]= # set the coordinates for the arch letters... rbind( # ...(rbind combines rows for y & x coordinates)... c(F:-F,(-F:F)[-1]), # ...to y = F..-F, and then -F+1..F (so: up & then down again) 1:a-2*F-1) # ...and x = across the arch from -2*F to +2*F a=a+2 # a=now the width of the base = size of arch + 2 p[,T+a+1:a-3]= # now set the coordinates of the base letters... rbind( # F+1, # ... base y = row F+1 (b=2*F+1):-b) # ... and x = goes (backwards) from 2*F+1..-2*F-1 T=T+2*a-2 # update the current letter index F=F+1} # increment the loop p=p[,1:n] # delete any excess coordinates p=p-min(p)+1 # re-zero the coordinates to remove negatives m=matrix(" ",b<-max(p),b) # create a new matrix filled with " " m[t(p)]=s # and fill it with the letters at the right positions n=apply(m,1,cat," # finally, print each row ")} ```