# Smooth as Teflon

Literally! April 6th is National Teflon Day, which is celebrated with Teflon-coated pans (what we will be making). So, given a positive integer n, create a Teflon pan. The "pan" section of the pan is an octagon with each of its sides consisting of n characters, which will vary depending on which side it is except for the sides using the character { or }. Those sides will have a character length of one always. If n is 1:

  _
/ \
{   }
\_/


As you can see, each side consists of one character (either {, }, /, \, or _). If n is 2:

   __
/  \
/    \
{      }
\    /
\__/


The handle will be created with n+3 ='s and end with a zero (0).

If n is one:

  _
/ \
{   }====0
\_/


n is 2:

   __
/  \
/    \
{      }=====0
\    /
\__/


n is 3:

    ___
/   \
/     \
/       \
{         }======0
\       /
\     /
\___/


If n is 4:

     ____
/    \
/      \
/        \
/          \
{            }=======0
\          /
\        /
\      /
\____/


Rules and Criterion

• No loopholes allowed

• Handle comes out the right hand side (the side made of the } character)

• Input is a positive integer

• If the side does not consist of either { or } (not the left or right side), they will consist of n respective characters:

            _
/ \
Left side {   } Right side
\_/

• Since this is , shortest code wins!
• Could you please add more test cases?
– xnor
Apr 6, 2017 at 22:37
• @xnor Added two more Apr 6, 2017 at 22:41
• The test cases for n=3 and n=4 don't have the right number of characters on the top or bottom edges Apr 6, 2017 at 23:04
• @fəˈnɛtɪk Thanks! That has been fixed Apr 6, 2017 at 23:25
• Can I take O instead of 0 for the knob? Apr 7, 2017 at 4:31

# Charcoal,  41 38 36 30 28 bytes

Thanks to @Emigna for helping to save two bytes, thanks to @ASCII-only for saving six bytes, and thanks to @Neil for saving another two bytes!

Ｎη↙η↑←×_η↖η↗{↗η×_η↓↘η}×=⁺³η0


Try it online!

Explanation:

Ｎη                 // Take the size of the pan as input.
↙η                 // Draw a line of η '\'s going down to the left.
↑←×_η              // Move one step up and print η underscores to the left.
↖η↗{↗η             // Print a line of η '\'s going up to the left.
// Then move one step north-east and print '{'.
// Then print a line of η '/'s going up to the right.
×_η↓               // Print '_' η times and move one step down.
↘η}                // Draw a line of η '\'s going down to the right, then print '}'.
×=⁺³η              // Print '=' η+3 times.
0                  // Print '0'

• You can move left of the starting point in Charcoal can't you? If so, starting at the tip of the handle should save a few bytes by not having to backtrack already printed space. Apr 7, 2017 at 6:15
• @Emigna Thanks, I didn't know that. I had never used Charcoal before. Apr 7, 2017 at 12:05
• @Steadybox 30 bytes: Ｎη↖ηＧ←η_↙↙η{↓↘ηＭ↑×η_↗η}×⁺³η=Ｐ0 Apr 9, 2017 at 23:44
• 28 bytes: Ｎη↙η↑←×_η↖η↗{↗η×_η↓↘η}×=⁺³η0 (1 byte saved by printing the bottom half of the pan first making the Ｍ unnecessary and 1 byte saved by reversing the parameters to × making the Ｐ unnecessary.)
– Neil
Dec 28, 2017 at 15:39

## JavaScript (ES6), 171 bytes

f=
n=>(r=s=>s[0][0].repeat(n-1)+s)  +r_
+r .replace(/ /g," $'/$' $$$\\\n")+{+r +r +r }+r====0+r .replace(/ /g,"\n$\$ '''/").replace(/ +\//,r_/) <input type=number min=1 oninput=o.textContent=f(this.value)><pre id=o> The whole pizza pan is very repetitious so the r function (designed as a tagged template literal) repeats the first character of its input n times. This handles the top and middle and lines of the pan. The rest is repeated by replacing a string of blanks; the  and ' subsitutions automatically correspond to increasing and decreasing numbers of blanks thus positioning the / and \ appropriately. Finally the _s are filled in on the last line as it's subtly different from the second line in that respect. ## JavaScript + HTML, 575 bytes (451 bytes only JS) 376 bytes (482 bytes only JS) y=document,y.y=y.getElementById,a=(b,c)=>{w="";for(z=0;z<b;z++)w+=c;return w},d=_=>{n=Number(y.y("n").value);s="";u=" ";j="<br>",m="\\",o="/";for(i=-2;i<=2*n;i++)-2==i?s+=a(n+1,u)+a(n,"_")+j:i<n-1?s+=a(n-i-1,u)+o+a(2*(i+1)+n,u)+m+j:i==n-1?s+="{"+a(3*n,u)+"}"+a(n+3,"=")+"0"+j:i+1==2*n?s+=a(n,u)+m+a(n,"_")+o:i+1<2*n&&(s+=a(i-n+1,u)+m+a(5*n-2*i-2,u)+o+j);y.y("p").innerHTML=s}; <input type="number" id='n'><button onclick='d()'>Do</button><p id='p' style='font-family:monospace;'></p> Not a complicated approach: several string concatenations using conditions for the five different parts of the pan: the uppermost, lowermost and middle lines and the upper and lower halves. I shortened as much as I could, but it was the limit with this method. EDIT: it wasn't - additionally golfed by @programmer5000 • Great first answer! Welcome to Programming Puzzles and Code Golf! Apr 7, 2017 at 1:33 • Was it great? I mean, it took much more time to make than it should have been and is not even really short - but thanks anyway! Apr 7, 2017 at 1:38 • You should visit the question on golfing tips for Javascript Apr 7, 2017 at 1:40 • Didn't know there are tips too - thanks! Apr 7, 2017 at 1:47 • Welcome to PPCG. For me any answer that shows some effort and a serious attempt to meet the challenge is a good answer and deserves an upvote. Good luck with the hints and tips. My first tip would be, stop thinking like the kind of programmer that you would want to work on a project with and start doing all of the things that you hate when you take over someone elses code (one letter variables, shortcut if statements, etc.) :) Apr 7, 2017 at 19:13 # PHP, 174 bytes echo(p=str_pad)("",-i=-1-n=argn),p(_,n,_);for(;i++<n;)echop(" ",1+a=abs(i)),i?p("\/"[i<0],1+n*3-a*2,"_ "[i<n])."\/"[i>0]:p("{",n*3).p("} ",5+n,"="). 0;  Takes input from STDIN; run with -nR or test it online. breakdown // first line echo(p=str_pad)("",-i=-1-n=argn),p(_,n,_); // loop i from -n to n for(;i++<n;)echo p("\n",1+a=abs(i)), // 1. left padding i? // if not middle line: p("\/"[i<0],1+n*3-a*2,"_ "[i<n]) // 2. left edge and inner padding ."\/"[i>0] // 3. right edge : // else: p("{",n*3) // 2. left edge and inner padding .p(" }",5+n,"=") // 3. right edge . 0 // 4. knob ;  # Python 3, 196 bytes n=int(input()) p=print s=' ' def m(i,f,b,c=s):p(s*(n-i)+f+c*(n+2*i)+b) p(s*n+s+'_'*n) for i in range(n):m(i,*'/\\') p('{'+s*n*3+'}'+'='*(n+3)+'0') for i in range(n-1,0,-1):m(i,*'\\/') m(0,*'\\/_')  I used a few variables to shorten the code, but it's mostly straightforward. Here's a longer, more readable version: n = int(input()) def middle_part(i, first_slash, second_slash, middle_char=' '): print(' ' * (n-i) + first_slash + middle_char * (n + 2*i) + second_slash) print(' ' * (n+1) + '_' * n) for i in range(n): middle_part(i, '/', '\\') print('{' + ' ' * n*3 + '}' + '=' * (n+3) + '0') for i in range(n-1, 0, -1): middle_part(i, '\\', '/') middle_part(0, '\\', '/', middle_char='_')  Edit: changed to read n from stdin, 181 → 196 bytes # Python 2, 180 178 bytes s,i=' ',input();R=range(i) print'\n'.join([s+s*i+'_'*i]+[s*(i-a)+'/'+s*(i+a*2)+'\\'for a in R]+['{'+s*i*3+'}'+'='*(i+3)+'0']+[s*(i-c)+'\\'+'_ '[c>0]*(i+c*2)+'/'for c in R[::-1]])  Try it online! # Python 2.7, 194195191187 185 bytes n=input();s=' ';a='\\';z='/' def m(f,b,i,c=s):print(n-i)*s+f+c*(n+2*i)+b m(s,s,0,'_') for i in range(n):m(z,a,i) print'{'+s*n*3+'}'+'='*(n+3)+'0';exec"m(a,z,i);i-=1;"*(n-1);m(a,z,0,'_')  Try it online! Open to edit suggestions to make it smaller. :) Edit 1: +1 byte - Credits to ElPedro for pointing out an error in the code, which made it 1 byte longer. Edit 2: -4 bytes - Credits to piyush-ravi for removing unneccesary arguments. Edit 3: -4 bytes - How did I not see that? :P Edit 4: -2 bytes - Replacing '\n' with ';' • It looks looks the first line below the middle line should not be there when I try it locally. tried it for input 4 and 3 and it looks wrong. Won't retract the upvote until you have had time to review and explain or fix though. My fault for not looking hard enough :) Apr 7, 2017 at 19:06 • Thanks for pointing it out ElPedro. Fixed it :) Apr 9, 2017 at 6:21 # PowerShell, 165 bytes param(n)(a=' '*n)+" "+(b='_'*n);n..1|%{' '*_+"/"+' '*(n+2*i++)+"\"};"{(a*3)}('='*(n+3))0";if(n-1){1..(n-1)|%{' '*_+"\"+' '*(n+2*--i)+"/"}};"a$b/"


Try it online!

Takes input $n, sets $a to a bunch of spaces, $b to a bunch of underscores, and string concatenates that with a space. That's left on the pipeline. Loops from $n down to 1. If $n=1, this will only execute once. Each iteration we do a string concatenation of spaces, a /, more spaces with counter $i, and a \. Those are all left on the pipeline.

Then comes the middle part with the handle, which coincidentally has $a*3 spaces in the middle, and $n+3 = signs, then a 0. That's left on the pipeline.

If $n is bigger than 1, then $n-1 is truthy so we enter the conditional, where we loop the other direction to form the bottom of the pan. If $n=1, then we don't need this portion due to how the lines work. Those are all left on the pipeline. We finish off with the spaces and underlines with the $a\$b/ bottom of the pan. All those strings from the pipeline are sent via implicit Write-Output that prints them with newlines in between elements. # JavaScript + HTML - 346 bytes JavaScript - 314 bytes, HTML - 32 bytes function o(a){a=parseInt(a),String.prototype.r=String.prototype.repeat;c=console.log,d=" ".r(a),e="_".r(a);c(" "+d+e);for(f=a-1,g=a;f>=0;f--,g+=2)c(" ".r(f+1)+"/"+" ".r(g)+"\\");c("{ }=0".replace(" "," ".r(3*a)).replace("=","=".r(a)));for(f=0,g=3*a;f<a-1;f++,g-=2)c(" ".r(f+1)+"\\"+" ".r(g-2)+"/");c(d+"\\"+e+"/")} <input id=n onkeyup=o(n.value)> # Un-golfed function o(sides) { String.prototype.r = String.prototype.repeat; var middle = '{ }=0', log = console.log, ss = ' '.r(sides), u = '_'.r(sides), sides = parseInt(sides); // top log(' ' + ss + u); // top mid for (var i = sides - 1, j = sides; i >= 0; i--, j += 2) { log(' '.r(i + 1) + '/' + ' '.r(j) + '\\'); } // mid log('{ }=0'.replace(' ', ' '.r(sides * 3)).replace('=', '='.r(sides))); // bottom mid for (var i = 0, j = sides * 3; i < sides - 1; i++, j -= 2) { log(' '.r(i + 1) + '\\' + ' '.r(j - 2) + '/'); } // bottom log(ss + '\\' + u + '/'); } <input id="n" onkeyup="o(n.value)"> # C, 249 bytes o(c,a){for(;a--;)putchar(c);}s;p(n){o(32,n+1);o(95,n);o(10,1);for(s=0;s<n;s++)o(32,n-s),o(47,1),o(32,n+s*2),o(92,1),o(10,1);o(123,1);o(32,n*3);o(125,1);o(61,3+n);o(48,1);o(10,1);for(s=n-1;s>-1;s--)o(32,n-s),o(92,1),o(s?32:95,n+s*2),o(47,1),o(10,1);}  Try it online • 212 bytes Oct 4, 2021 at 7:55 # Vyxal, 69 bytes ›\_?*꘍,(nε\/꘍₴nd⁰+\\꘍,)\{₴3*\}꘍₴3+\=*0+,(n›\\꘍₴nε‹d+n›⁰= _$i\$*₴\/,)


Try it Online!

Unfortunate bytecount...