[Question]
  [
Your task: given a number `n`, generate a '+' sign that is `n` characters away from its center. If this is confusing, check out the test cases.
Standard methods of input: output must be a string or printed. Standard loopholes apply.
```
Input: 1
Output: +           ] 1 away from center `+`.
Input: 2
Output:  +          ] 2 away from center `+`.
        +++         ] 1 away from center `+`.  
         +
Input: 3
Output:   +         ] 3 away from center `+`.
          +
        +++++
          +
          +
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code wins!
  
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 5 bytes
```
Ｐ+×+Ｎ
```
[Try it online!](https://tio.run/nexus/charcoal#@/9@zwbtw9O13@9Z9/@/MQA "Charcoal – TIO Nexus")
[Answer]
# [Python 2](https://docs.python.org/2/), 53 bytes
```
n=2*input()-1;C='+'.center
for c in C(n):print C(n,c)
```
[Try it online!](https://tio.run/nexus/python2#@59na6SVmVdQWqKhqWto7Wyrrq2ul5yaV5JaxJWWX6SQrJCZp@CskadpVVCUmVcCYuoka/7/bwwA "Python 2 – TIO Nexus")
[Answer]
# JavaScript (ES6), ~~67~~ ~~65~~ ~~63~~ ~~60~~ 59 bytes
```
x=>(v=(` `[r=`repeat`](--x)+`+
`)[r](x))+`+`[r](x*2)+`+
`+v;
```
* 2 bytes saved by replacing two occurrences of `x-1`, the first with `--x` and the second with `x`.
* 2 bytes saved thanks to [Kritixi Lithos](https://codegolf.stackexchange.com/users/41805/kritixi-lithos), replacing `"\n"` with ``[newline]``.
* 3 bytes saved thanks to [user2428118](https://codegolf.stackexchange.com/users/13486/user2428118), finally helping me to figure out a way to alias the `repeat` in a way that reduced the size. (With honourable mention to [Marie](https://codegolf.stackexchange.com/users/67066/marie) for her efforts, too)
* 1 byte saved indirectly thanks to Herman.
---
## Try It
```
f=
x=>(v=(` `[r=`repeat`](--x)+`+
`)[r](x))+`+`[r](x*2)+`+
`+v;
oninput=_=>o.innerText=f(+i.value)
o.innerText=f(i.value=3)
```
```
<input id=i min=1 type=number><pre id=o>
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 11 bytes
```
tZv=&+g43*c
```
[Try it online!](https://tio.run/nexus/matl#@18SVWarpp1uYqyV/P@/MQA "MATL – TIO Nexus")
### Explanation with example
Consider `n = 3`.
```
t     % Implicitly input n. Duplicate
      % STACK: 3, 3
Zv    % Symmetric range
      % STACK: 3, [1 2 3 2 1]
=     % Equal, element-wise
      % STACK: [0 0 1 0 0]
&+    % All pair-wise additions. Gives a 2D array
      % STACK: [0 0 1 0 0;
                0 0 1 0 0;
                1 1 2 1 1;
                0 0 1 0 0;
                0 0 1 0 0]
g     % Logical: convert non-zero to one
      % STACK: [0 0 1 0 0;
                0 0 1 0 0;
                1 1 1 1 1;
                0 0 1 0 0;
                0 0 1 0 0]
43*   % Multiply by 43 (ASCII for '+'), element-wise
      % STACK: [ 0  0 43  0  0;
                 0  0 43  0  0;
                43 43 43 43 43;
                 0  0 43  0  0;
                 0  0 43  0  0]
c     % Convert to char. Char 0 is displayed as space. Implicitly display.
      % STACK: ['  +  ';
                '  +  ';
                '+++++';
                '  +  ';
                '  +  ']
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~16~~ 13 bytes
```
Ｎα×+α←↑×+α‖Ｏ↘
```
[Try it online!](https://tio.run/nexus/charcoal#@/9@z7pzGw9P1z638VHbhEdtEyHMhmnv96x/1Dbj/39jAA "Charcoal – TIO Nexus")
Uses a different approach from the other Charcoal answer.
### Explanation
```
Ｎα                       # Take input and store it in variable α
×+α                       # α times write a +
←                         # Go left
↑×+α                      # α times write a + upwards
```
Now the top left corner is complete, it will look something like this:
```
  +
  +
+++
‖Ｏ↘                      # Reflect-overlap it in a SE direction
```
The last step is the key to this program, it uses the top-left part of the plus to generate the rest of the plus by reflecting it in the southeast direction (rightwards and downwards).
[Answer]
# [Shakespeare Programming Language](https://github.com/TryItOnline/spl), ~~749~~ ~~743~~ ~~666~~ 625 bytes
```
N.Puck,.Page,.Ford,.Ajax,.Act I:.Scene I:.[Enter Puck and Ford]Puck:Listen tothy!Ford:You is the difference betweena cat I.Scene V:.[Exeunt][Enter Page and Ajax]Ajax:You is the difference betweena cat Ford.Scene X:.Page:You is the product ofPuck I.Is you as big as zero?If soyou is the sum oftwice the sum oftwice twice the sum ofa big big cat a cat a cat a cat.If notyou big big big big big cat.Speak thy!Ajax:You is the sum ofyou a cat.Is you worse Ford?If soLet usScene X.Page:You is twice the sum ofa big big cat a cat.Speak thy![Exit Page][Enter Puck]Ajax:You is the sum ofyou a cat.Is you worse Ford?If soLet usScene V.
```
[Try it online!](https://tio.run/##rVHBasMwDP0V7R582S2XsUMHgTIKhbJRfHAdpfXa2cGWSbOfzywnZVl22A47WLZk6b0nKbSXYXgWm6jPhdioIxbiyfm6EI9v6pqsJqhKsdVokR/7lSX0wOmgbA2cK9kr1yYQWiBHp/6Ow@Wri2AC0AmhNk2DHq1GOCB1iFaBVgl6Qt4x8hWjJXljSFIyA@uQbP6Cx7wT5EuZ25lXtd7VMTXkmqy/ElWAPn2rAAdz5OsDvXuoGgiu/yoL8T2VUGcS2w9/EVUZiQ/LUUsrErZ1xOC3vPnhjG2L6gw8xGXTI0MWPGKN6jvnA@bOR@VrJIhhGsL3GfwudkafFmIo70HOti7/QdVODMP9Jw "Shakespeare Programming Language – Try It Online")
With added newlines:
```
N.
Puck,.
Page,.
Ford,.
Ajax,.
Act I:.
Scene I:.
[Enter Puck and Ford]
Puck:Listen tothy!
Ford:You is the difference betweena cat I.
Scene V:.
[Exeunt]
[Enter Page and Ajax]
Ajax:You is the difference betweena cat Ford.
Scene X:.
Page:You is the product ofPuck I.Is you as big as zero?
If soYou is the sum ofTwice the sum ofTwice twice the sum ofA big big cat a cat a cat a cat.
If notyou big big big big big cat.Speak thy!
Ajax:You is the sum ofyou a cat.Is you worse Ford?If soLet usScene X.
Page:You is twice the sum ofa big big cat a cat.Speak thy!
[Exit Page]
[Enter Puck]
Ajax:You is the sum ofyou a cat.Is you worse Ford?If soLet usScene V.
```
Golfed 6 bytes because scene numbers don't have to be consecutive. Golfed some more bytes by applying the tips in the new answers to the [Shakespeare tips question](https://codegolf.stackexchange.com/questions/48855/), **though these golfs aren't reflected in the explanation**.
## (Slightly outdated) explaination
SPL is an esolang designed to look like Shakespeare plays. Positive nouns have the value of 1 (here **cat** is used) and negative nouns have the value of -1 (none were used but **pig** is one of them). Adjectives modify a constant by multiplying it by 2.
```
N.
```
Everything until the first dot is the title and doesn't matter.
```
Puck,.                           row counter
Page,.                           column counter
Ford,.                           input
Ajax,.                           temp
```
The characters are integer variables, each of them also has a stack but I did not need to use that feature.
```
Act I:.
Scene I:.
```
Acts and scenes are used as goto labels
```
[Enter Puck and Ford]
```
It's only useful if exactly two characters are on the stage at the same time.
```
Puck:Listen to thy heart!
```
Reads a number and makes Ford remember it.
```
Ford:You is the difference between a cat and I.
```
As you can see Engrish is valid in SPL. This makes Puck's value "the different between a cat and I". But what does it mean? `cat` is a positive noun, so it's `Puck = 1 - Ford`.
```
Scene II:.
[Exeunt]
```
Exeunt is just a plural of "exit", and without arguments means that everyone on the stage exits.
```
[Enter Page and Ajax]
Ajax:You is the difference between a cat and Ford.
```
It's also `Page = 1 - Ford` but it's spoken by a different actor so `I` would be wrong. Since it's a loop, I can't just copy the value of `Puck`.
```
Scene III:.
Page:You is the product of Puck and I.
```
Pretty straightforward by now. `Ajax = Puck * Page`.
```
Is you as big as zero?
```
"as [adj] as" is the `==` operator.
```
If so,you is the sum of the sum of the sum of a big big big big big cat and a big big big cat and a big cat and a cat.
```
If Ajax == 0... "cat" is 1, "big cat" is 2, "big big cat" is 4 and so on. After substituting the simple constants we get "the sum of the sum of the sum of 32 and 8 and 2 and 1" -> "the sum of the sum of 40 and 2 and 1" -> "the sum of 42 and 1" -> "43", which is the ASCII for +.
```
If not,you fat fat fat fat fat cat.
```
else it's just "fat fat fat fat fat cat", so Ajax gets the value of 32, the ASCII for a space.
```
Speak thy mind!
```
This is the command for outputting a character.
```
Ajax:
You sum you and cat.Is you as big as Ford?If not,let us return to Scene III.
```
This is a loop construct. "You sum you and cat" increments Page, and `if(Page != Ford) goto Scene III`. The rest of the program uses the same components, so here is a more readable pseudocode version:
```
Scene1:
    input = [input number];
    row = 0 - input + 1;
Scene2:
    col = 0 - input + 1;
Scene3:
    temp = row * col;
    if(temp == 0){
        temp = '+';
    }else{
        temp = ' ';
    }
    putchar(temp);
    Page = Page + 1;
    if(Page != Ford) goto Scene3;
    Ajax = 10;
    putchar(Ajax);
    Puck = Puck + 1;
    if(Puck != Ford) goto Scene2;
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
ṬŒB»þ`ị⁾+ Y
```
[Try it online!](https://tio.run/nexus/jelly#ARkA5v//4bmsxZJCwrvDvmDhu4vigb4rIFn///8z "Jelly – TIO Nexus")
[Answer]
## Mathematica, 39 bytes
```
Print@@@(CrossMatrix[#-1]"+"/. 0->" ")&
```
`CrossMatrix` is a built-in that generates a matrix of the required shape with `1`s instead of `+`s and `0`s instead of spaces. If we multiply that matrix by `"+"`, that replaces the `1`s with `+`s while leaving the `0`s unchanged (obviously... `0*x = 0` and `1*x = x`, right?). Then we replace the zeros manually with spaces using `/. 0->" "`. Finally, we print each line of the matrix with `Print@@@(...)`.
[Answer]
# C, 69 bytes
Not very interesting... Loops over the square, printing out the appropriate character.
```
r,c;f(n){for(r=-n;++r<n;puts(""))for(c=-n;++c<n;putchar(r*c?32:43));}
```
[Answer]
# Ruby, ~~41~~ 40 bytes
```
->x{puts k=[?\s*(r=x-1)+?+]*r,?+*r+=x,k}
```
[Try it online!](https://tio.run/nexus/ruby#S7ON@a9rV1FdUFpSrJBtG20fU6ylUWRboWuoqW2vHatVpGOvrVWkbVuhk137X8NQT89UUy83sUBBLe0/AA "Ruby – TIO Nexus")
[Answer]
# [Python 2](https://docs.python.org/2/), 52 bytes
```
n=input()-1
p=(' '*n+'+\n')*n
print p+'++'*n+'+\n'+p
```
[Try it online!](https://tio.run/nexus/python2#@59nm5lXUFqioalryFVgq6GuoK6Vp62uHZOnrqmVx1VQlJlXolAAFNCGi2sX/P9vDAA "Python 2 – TIO Nexus")
A 53-byte alternative ([TIO](https://tio.run/nexus/python2#@59nm5lXUFqioalryJWWX6SQrJCZp66grpWnrQ6CIJZVQVFmXolCMlQMSP//bwwA "Python 2 – TIO Nexus")):
```
n=input()-1
for c in' '*n+'+'+' '*n:print c*n+'+'+c*n
```
[Answer]
# [GNU sed](https://www.gnu.org/software/sed/), ~~104~~ 99 bytes
-5 thanks to [seshoumara](https://codegolf.stackexchange.com/users/59010/seshoumara)  
Includes +1 for `-r`
```
s/1//;h;:;s/(.*)1/ \12/;t;s/( *2)2(2*)/\1\n\1\2/
t;G;s/1+/&&1/;s/(.*)(\n1*)/&\n\1/;/1/!c+
y/12/++/
```
Takes input in [unary.](http://meta.codegolf.stackexchange.com/questions/5343/can-numeric-input-output-be-in-unary?answertab=votes#tab-top)
[Try it online!](https://tio.run/nexus/sed#LYw7DoMwEER7TgEN8kdkNFtmD5BLWDQ0UMRE2A2Xj7MRFFOM5s1rBQR01acWuEfwRJ8o0Gp9dn0QL06CR2LKFsG7q/qykRHjSNw3lzIvSv4c1LTDErsTJosRrZH87p@67bm06fgB "sed – TIO Nexus")
```
s/1//                    # Subtract 1 from input
h                        # Hold onto input
:                        # Start loop
s/(.*)1/ \12/            #   Remove a 1, prepend a space, and append a 2
t                        # Loop until all 1s are 2s
                         # Start Loop (uses the previous label)
s/( *2)2(2*)/\1\n\1\2/   #   Shift all but the first 2 from the last line to a new line 
                         #   E.g.  "  2"      "  2"
                         #         "  222" -> "  2"
                         #                    "  22"
t                        # Loop until all 2s are on their own line
G                        # Append a newline and input
s/1+/&&1/                # Double the number of 1s and append an extra
s/(.*)(\n1*)/&\n\1/      # Copy all of the lines with 2s to the end
/1/!c+                   # If there aren't any 1s print a '+'
y/12/++/                 # Convert all 1s and 2s to +s
```
[Answer]
**R, 54 bytes**
Shaving off 7 bytes thanks to @Jarko Dubbeldam:
```
function(n){a=matrix("",y<-n*2-1,y);a[n,]=a[,n]="x";a}
```
previous answer:
```
f=function(n){a=matrix("",n*2-1,n*2-1);a[n,]="x";a[,n]="x";a}
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 48 bytes
```
param($n)($x=,(" "*--$n+"+")*$n);'+'*(1+2*$n);$x
```
[Try it online!](https://tio.run/nexus/powershell#@1@QWJSYq6GSp6mhUmGro6GkoKSlq6uSp62kraSpBRS2VtdW19Iw1DYCc1Qq/v//bwIA "PowerShell – TIO Nexus")
Takes input `$n`. Starts by constructing a string of `--$n` spaces, concatenated with `+`. That's converted into an array using the comma operator, (newly-decremented) `$n` times. That array is stored in `$x` and encapsulated in parens to place a copy on the pipeline.
We then do the middle section, which is `+` string multiplied out the appropriate number of times. That's left on the pipeline. Finally, we put `$x` on the pipeline again.
Those are all left on the pipeline at program completion, and the implicit `Write-Output` inserts a newline between elements.
[Answer]
# Python 2, 65 bytes
```
lambda n:('g+\n'*~-n+'+'*~-(2*n)+'\ng+'*~-n).replace('g',' '*~-n)
```
[Try it Online!](https://tio.run/nexus/python2#S7ON@Z@TmJuUkqiQZ6Whnq4dk6euVaebp62uDaI1jLTyNLXVY/LSwdw8Tb2i1IKcxORUoFJ1HXUFiOD/gqLMvBKFNA1jTS4Y01TzPwA)
[Answer]
# Lua ~~113~~, 90 bytes
```
r,w,p=string.rep,io.read(),io.write;s=r(' ',w-1)p(r(s..'+'..'\n',w-1))p(r('+',w*2-1)..'\n')p(r(s..'+'..'\n',w-1))
```
```
r,w=string.rep,io.read()d=w*2-1;for a=1,d do print(a~=w and r(' ',w-1)..'+'or r('+',d))end
```
[Answer]
## [CJam](https://sourceforge.net/p/cjam), 23 bytes
```
ri_(S*'++a\2*(*_z..e>N*
```
[Try it online!](https://tio.run/nexus/cjam#@1@UGa8RrKWurZ0YY6SloRVfpaeXauen9f@/KQA "CJam – TIO Nexus")
### Explanation
This feels a bit suboptimal, but the idea is to superimpose the following two grids:
```
  +
  +
  +
  +
  +
```
```
+++++
```
Which gives the desired result.
```
ri    e# Read input and convert to integer N.
_(    e# Duplicate and decrement.
S*    e# Get a string of N-1 spaces (indentation of the vertical bar).
'++   e# Append a + (the vertical bar).
a     e# Wrap the line in an array.
\2*(  e# Swap with the other copy of N and compute 2N-1.
*     e# Repeat the line that many times.
_z    e# Duplicate the grid and transpose it.
..e>  e# Pairwise maximum between the two grids. This superimposes them.
N*    e# Join with linefeeds.
```
[Answer]
# [Perl 5](https://www.perl.org/), 45 bytes
44 bytes of code + `-p` flag.
```
$_=join"+
",@%=($"x--$_)x$_,"+"x($_*2),@%,""
```
[Try it online!](https://tio.run/nexus/perl5#U1YsSC3KUdAt@K8Sb5uVn5mnpM2lpOOgaquholShq6sSr1mhEq@jpK1UoaESr2WkCZTSUVL6/9@Qy5jLlMsSAA "Perl 5 – TIO Nexus")
---
Some similar (but still different) approaches:
48 bytes (47+`-p`): 
```
$_=join"+"x($_*2-1).$/,(~~($"x--$_."+\n")x$_)x2
```
50 bytes (49+`-n`):
```
$,="+"x($_*2-1).$/;print+(~~($"x--$_."+\n")x$_)x2
```
[Answer]
# CJam, 17
```
ri(S*_]'+*_ffe>N*
```
[Try it online](http://cjam.aditsu.net/#code=ri(S*_%5D'%2B*_ffe%3EN*&input=3)
**Explanation:**
```
ri(      read n, convert to int and decrement
S*       make a string of n-1 spaces
_]       duplicate it and put the 2 strings in an array
'+*_     join the strings with a '+' and duplicate the result
ffe>     for each pair of characters from the 2 (identical) strings,
          get the larger character (results in a matrix)
N*       join the rows with newlines
```
[Answer]
# Octave, ~~36~~ 31 bytes
Inspired by @LuisMendo 's MATL answer.
```
@(n)' +'(((a=1:n*2-1==n)|a')+1)
```
[Try it online!](https://tio.run/nexus/octave#@@@gkaeprqCtrqGhkWhraJWnZaRraGubp1mTqK6pbaj5PzGvWMNU8z8A "Octave – TIO Nexus")
Previous answer:
```
@(n)' +'(1+((a=padarray(1,n-1))|a'))
```
[Try it online!](https://tio.run/nexus/octave#@@@gkaeprqCtrmGoraGRaFuQmJJYVJRYqWGok6drqKlZk6iuqfk/Ma9Yw1TzPwA "Octave – TIO Nexus")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~15~~ ~~14~~ 12 bytes
```
F'+}¹·<×)û.c
```
[Try it online!](https://tio.run/nexus/05ab1e#@@@mrl17aOeh7TaHp2se3q2X/P@/MQA "05AB1E – TIO Nexus")
**-2 thanks to Emigna.**
[Answer]
# [Python 2](https://docs.python.org/2/), ~~60,~~56 bytes
```
n=input()-1
z=(' '*n+'+\n')*n
print z+'+'*(2*n+1)+'\n'+z
```
[Try it online!](https://tio.run/nexus/python2#@59nm5lXUFqioalryFVlq6GuoK6Vp62uHZOnrqmVx1VQlJlXolAFFFDX0jACyhhqaqsD5bSr/v83BgA "Python 2 – TIO Nexus")
* -4 bytes - thanks to math junkie!
[Answer]
# JS (ES6), ~~88~~ ~~74~~ 73 bytes
```
x=>(x--,y=y=>(" ".repeat(x)+`+
`).repeat(x),y``+"+".repeat(x+x+1)+"\n"+y``)
```
Probably can be golfed more.
```
Snippetify(x=>(x--,y=y=>(" ".repeat(x)+`+
`).repeat(x),y``+"+".repeat(x+x+1)+"\n"+y``))
```
```
<script src="https://programmer5000.com/snippetify.min.js"></script>
<input type = "number">
<pre data-output></pre>
```
[Answer]
## JavaScript (ES6), 60 bytes
```
f=
n=>(r=([s,t])=>(s=s.repeat(n-1))+t+s+`
`)([r(` +`),r(`++`)])
```
```
<input type=number min=1 oninput=o.textContent=f(this.value)><pre id=o>
```
Outputs two trailing newlines. Alternative formulation, also 60 bytes:
```
n=>(r=a=>(s=a[0].repeat(n-1))+a[1]+s+`
`)([r(` +`),r(`++`)])
```
[Answer]
## Batch, 108 bytes
```
@set p=+
@set l=@for /l %%i in (2,1,%1)do @
%l%call set p= %%p%% 
%l%echo %p%
@echo %p: =+%
%l%echo %p%
```
Note: Line 3 ends in a space.
[Answer]
# PowerShell, 48
Doesn't seem to get shorter than that (and pretty much the same approach as the other solution):
```
($a=,(' '*($n="$args"-1)+'+')*$n)
'+'+'++'*$n
$a
```
or
```
($a=(' '*($n="$args"-1)+'+
')*$n)+'++'*$n+"+
$a"
```
[Answer]
# [V](https://github.com/DJMcMayhem/V), ~~19~~ ~~18~~ 15 bytes
*Golfed 3 bytes thanks to @nmjcman101 by using `.` and `Ò+`*
```
Àé r+À«Ä.MgJxÒ+
```
[Try it online!](https://tio.run/nexus/v#@3@44fBKhSLtww2HVh9u0fNN96o4PEn7////xgA "V – TIO Nexus")
[Answer]
## REXX, 81 bytes
```
arg a
b=a*2-1
do i=1 to b
  if i=a then say copies('+',b)
  else say right('+',a)
  end
```
[Answer]
# PHP, 68 Bytes
```
for(;$i<$c=-1+2*$m=$argn;)echo"\n".str_pad("+",$c," +"[$m==++$i],2);
```
83 Bytes
```
for(;$i<($c=($n=$argn)*2-1)**2;)echo$i%$c?"":"\n".!++$k," +"[$k==$n|$i++%$c==$n-1];
```
[Answer]
# MUMPS, 48 ~~50~~ ~~53~~ bytes
```
F i=1-n:1:n-1 W ! F j=1-n:1:n-1 W $C(i&j*-11+43)
```
]