12

APL (Dyalog Extended), 55 bytesSBCS Anonymous infix lambda. Takes r as left argument (⍺) and ingredient initials as right argument (⍵). {i@((≢i←⍺/⍵)?≢⍸1=n)@{1=n}'@# '[n←(0⍺,⍺+1)⍸⍤1|∘.⌾⍨⍺…-⍺]} Try it online! {…} "dfn"; left argument ⍺ (leftmost Greek letter), right argument ⍵ (rightmost Greek letter) '@# '[…] index the string with:   -⍺ negate r   ⍺… ...


9

Charcoal, 5 bytes G↗↘N# Try it online! Link is to verbose version of code. Explanation: The G draws a filled polygon, where the ↗↘ specifies the sides to follow (the polygon is automatically closed) and the N inputs the size and the # specifies the fill character. Using G↖↙N# also works of course. Alternate solution, also 5 bytes: G^N#⟲ Try it online! ...


6

05AB1E, 42 41 40 38 34 bytes ÝRûãnOtï¹.S…# 1sèƶDþ.rI¹и'@Þ«‡¹·>ô Output as a character-matrix. -2 bytes because the specs changed (character-list input instead of ingredients-list). -4 bytes thanks to @Grimmy. Try it online or verify all test cases. (The footer J» is to pretty-print the result. Feel free to remove it to see the actual character-matrix ...


6

MATL, 44 43 40 34 bytes Q_Zvqt!YytGQ<Zc64bG<(i1GY"7MfynZr( Inputs are: r and a string with the initials of ingredients. Try it online with ham, onion, pepper and mushroom! Or maybe try a diet pizza. Explanation with example Consider inputs 3 and 'AP'. Q % Implicit input: r. Add 1 % STACK: 4 _Zv % Symmetric inverse range % STACK: ...


5

PowerShell, 36 bytes "$args"..1|%{" "*--$_+"#"*++$i;$i++} Try it online! Loops from input $args down to 1, each iteration constructing a string consisting of the appropriate number of spaces plus a number of # marks that starts at 1 and increments by 2 every iteration. Those strings are left on the pipeline, and implicit output gives us newlines for free.


4

C (gcc), 104 \$\cdots\$ 72 71 bytes Saved 5 11 bytes thanks to S.S.Anne!!! Saved 6 bytes thanks to gastropner!!! Saved a byte thanks to Stephen!!! i;j;f(n){for(i=0;i++<n;)for(j=0;j<i*2;)printf(j++?"#":"\n%*s",n-i,"");} Try it online!


4

Python 2, 46 bytes def f(n,i=1):1/n;print" "*~-n+"#"*i;f(n-1,i+2) Try it online! Basically the same solution as Jonathan Allan, but a function that prints and terminates with error, if that's allowed here. The 1/n is used to halt execution where n=0. Maybe there's a way to do that shorter by stuffing in a /n or %n somewhere.


4

05AB1E, 8 bytes Multiple 8 bytes programs are possible: ·ÅÉ'#×.c: Try it online or verify all test cases. L'#×€û.c: Try it online or verify all test cases. L·<'#×.c: Try it online or verify all test cases. '#×ηj€û»: Try it online or verify all test cases. Explanations: · # Double the (implicit) input-integer # i.e. 3 → 6 ÅÉ # ...


3

Ruby, 46 43 bytes f=->g{g.times{|n|puts" "*(g-n)+?#*(2*n+1)}} Try it online! -3 thanks to IMP1


3

J, 19 18 bytes ' #'(#~|.,.1++:)i. Try it online! -1 byte thanks to FrownyFrog Let's do 3: i. Produces: 0 1 2 |.,.1++: - Reverse |. produces 2 1 0 and 1 + the double +: produces 1 3 5. Then we zip ,. those together: 2 1 1 3 0 5 ' #'#~ copies each character in the 2-character string # (space and pound) according to the mask specified above, and pads ...


3

JavaScript (ES7),  177 175  172 bytes Takes input as (r)(list), where list is filled with initials. Returns an array of characters. r=>a=>a.map(i=>(g=i=>(s[p=Math.random()*r**3|0]!='@'||(s[p]=i,--n))&&g(i))(i,n=R),s=[...(g=x=>y+r?` #@ `[x+r?((d=x*x--+y*y)<r*r)+(d<R*R):(--y,x=R,3)]+g(x):'')(y=R=r++)])&&s Try ...


3

Python 3.8 (pre-release), 186 177 176 bytes from random import* def f(r,i=[],s=''):i=['@',*next(zip(*i),[])];t=range(-r,R:=r+1);print([s:=s+[' #'[(d:=x*x+y*y)<R*R],choice(i)][d<r*r]+'\n'*(x==r)for y in t for x in t][-1]) Try it online!


2

StupidStackLanguage 28 bytes jfffavvflflqvvvviifblflflfff Explanation: j # Get the input (x) fff # first 3 avv # new line fl # print new line fl # first x qvvvviifb # space lf # second x lf # new line lfff # last 3 x's


2

C (gcc), 333 326 314 292 290 bytes f[17][9],i,x=8,y=4;main(n){for(;i++%4||read(0,&n,3)*sscanf(&n,"%02x",&n);n/=4)f[x+=n%2?x<16:-!!x][y+=n&2?y<8:-!!y]+=f[x][y]<14;f[8][4]=15;for(f[x][y]=puts(n="+-----------------+")-4;++i<75;puts("|"))for(x=!printf("|");x<17;)putchar(" .o+=*BOX@%&#/^SE"[y=fmin(f[x++][i-66],16)]);puts(n);} ...


2

PowerShell, 146 132 bytes param($x,$y,$b)&($t={$b|%({$r+=,$_*$y},{$r=,$_*-$y+$r})[$y-lt0] $r-ne$e})|%{$b=,$_*8|%{''+' X'[($_-shr$i++%8)%2]} $y=-$x;-join(&$t)} Try it online! Unrolled: param($x,$y,$bitmap) $transform={ $bitmap|%({$r+=,$_*$y},{$r=,$_*-$y+$r})[$y-lt0] $r -ne $empty } &$transform|%{ # $...


2

cQuents, 18 bytes | &@ (n-$)~@#(2$-1 Try it online! Explanation | terms in sequence are separated by newline & output first n terms in sequence each term is: @ " " * (n-$) n - index ~ concat @# ...


2

APL+WIN, 23 bytes Prompts for integer: (-⌽⍳n)⌽⊃(1+2×⍳n←⎕)⍴¨'#' Try it online! Courtesy of Dyalog Classic


2

MATL, 11 bytes :&<~P2&ZvZc Try it online! How it works Consider input 3 as an example. : % Implicit input. Range % STACK: [1 2 3] &< % Pairwise less-than comparison % STACK: [0 0 0; 1 0 0 1 1 0] ~ % Negate, elementwise % STACK: [1 1 1; 0 1 1; ...


2

Python 2, 48 bytes n=input();v=1 while n:n-=1;print' '*n+'#'*v;v+=2 Try it online! A fun 49 with an extra space of padding is: s=' '*input()+'#' while'#'>s:print s;s=s[1:]+'##' Try that


2

Red, 78 76 bytes func[n][s: copy"#"repeat i n[print pad/left s n + i - 1 append s"##"take s]] Try it online! Alternative using Red's parse: Red, 77 bytes func[n][s: to""pad/left"#"n loop n[parse s[(print s take s)to"#"insert"##"]]] Try it online!


2

k4, 29 bytes {(-x+!x)$|:'x#x("##",)\"# "} { } /lambda with implicit arg `x` x("##",)\"# " /function composition - cumulatively join (,) "##" to "# " x times and return intermediate results ("# ";"### ";"##### ") etc x# /take x items |:' /reverse each (-x+!x) ...


2

Rule 222, 1 byte (noncompeting) # Wolfram codes describe a family of celular automata. While most behave in very simple ways, some of them show very complex behaviour. Rule 110 is even Turing complete. Rule 222 is one of the "simple" ones. After n generations, it produces a triangle of n levels, as specified in the challenge. A synonymous cellular ...


2

Charcoal, 51 48 bytes E⊕θ⭆E⊕θ₂⁺×ιι×λλ⎇›θλ@§ #›⊕θλ‖O↑←FηFθ§≔KA‽⌕AKA@§ι⁰ Try it online! Link is to verbose version of code. Now supports full topping names by using a less convenient input format, but could save 2 bytes by switching back to initials. Explanation: E⊕θ⭆E⊕θ₂⁺×ιι×λλ⎇›θλ@§ #›⊕θλ Draw the bottom right hand quarter of the pizza base. ‖O↑← ...


2

05AB1E, 52 50 47 bytes '|'/ILúí`©'oI>и'|šðý2äнI·иI>'-×'*ì.ø`®ð'_:».º.c Can definitely be golfed some more, but this will do for now. Try it online or verify some more test cases. Explanation: '| '# Push a "|" IL # Push a list in the range [1,input] '/ ú '# Push a "/" with that many leading spaces í ...


2

Charcoal, 38 bytes NθP×θ_←↗¹Pθ←²↑*↑⊗θ↘*UO⊕θ⊗θo ↑P⊕θ↑↗θ|‖B Try it online! Link is to verbose version of code. Works by drawing the left half of the rocket and reflecting it. Explanation: Nθ Input the size of the rocket. P×θ_ Print the _s at the base of the rocket. ←↗¹ Move left and print the / at the left of the base. Pθ←² Print the -s on the second ...


2

JavaScript (ES6), 164 bytes Builds the rocket recursively. f=(n,x=y=0,w=2*n+2)=>w-y>~n?`/\\ |*-o `[(x>w?x=~!++y:(y?y+~n&&y-w-n?y>n?x&1?2:x%w?6:3:x+y+~n&&x-y+~n&&2:x%w?5:4:x+~n?2:3)||x>n)&7]+f(n,x+1):` /${'_'.repeat(w-3)}\\` Try it online! Commented f = ( // f is a recursive ...


2

Wren, 156 bytes I am very surprised that Arnauld is so easy to outgolf ... Fn.new{|n|" "*(n+1)+"| "+(n..1).map{|i|" "*i+"/%(" "*(1+2*(n-i)))\\ "}.join()+"*%("-"*(1+2*n))* "+"| %("o "*n)| "*2*n+"*%("-"*(1+2*n))* /%("_"*(2*n-1))\\"} Try it online!


2

T-SQL, 265 bytes DECLARE @n INT=0,@o varchar(max)=''z:SELECT @o+=space(@-@n)+'/'+replicate(' ',@n*2)+' \ ',@n+=1IF @n<@ GOTO z PRINT space(@)+' | '+@o+stuff(replicate('*'+replicate('-',@*2+1)+'* ',2),5+2*@,0,replicate('|'+replicate(' o',@)+' | ',2*@))+' /'+replicate('_',@*2-1)+'\' Try it online


2

PowerShell, 131 bytes param($n)' '*($n+1)+"|" $n..1|%{" "*$_+'/'+" "*++$i+'\';$i++} ($x='*'+'-'*++$i+'*') ,("| "+'o '*$n+"|")*2*$n $x ' /'+'_'*($i-2)+'\' Try it online! Line breaks added for clarity, but they could just as easily be ; (it's the same byte count either way). We're basically brute-force building the rocket one line at a time. We start by ...


1

Japt -R, 9 bytes õî'# mê û Try it Or 7 bytes if we can choose which character to use. õ_î¬êÃû Try it


Only top voted, non community-wiki answers of a minimum length are eligible