[Question]
  [
For the purpose of this question a meandering curve is one that follows the general direction from left to right, but makes repeatedly n+1 turns at 90 degrees to the left and then n+1 turns to the right (for n>0).
In fact the meander itself will have `n` segments.
The turns are denoted with `+`.
The width of the meanders (the distance between two `+`) is 3 at the horizon (`---`) and 1 at the vertical (`|`)
Here are the single segments a meandering curve with sizes n from 1 to 5: 
```
                                                           +-------------------+
                                                           |                   |
                                       +---------------+   |   +-----------+   |
                                       |               |   |   |           |   |
                       +-----------+   |   +-------+   |   |   |   +---+   |   |
                       |           |   |   |       |   |   |   |   |   |   |   |
           +-------+   |   +---+   |   |   +---+   |   |   |   +---+   |   |   |
           |       |   |   |   |   |   |       |   |   |   |           |   |   |
   +---+   +---+   |   +---+   |   |   +-------+   |   |   +-----------+   |   |
   |   | 1     |   | 2         |   | 3             |   | 4                 |   | 5
---+   +-------+   +-----------+   +---------------+   +-------------------+   +   
```
## Challenge:
Given two positive numbers `n` and `m`, draw `m` segments of a meandering curve with size `n`.
You can write a full program or a function.
## Input:
`n` > 0 The size of the curve
`m` > 0 Number of segments to draw
## Output:
An ASCII representation of the meandering curve.
## Examples:
```
n = 3
m = 2
   +-----------+   +-----------+   
   |           |   |           |
   |   +---+   |   |   +---+   |
   |   |   |   |   |   |   |   |
   +---+   |   |   +---+   |   |
           |   |           |   |  
-----------+   +-----------+   +
n = 2
m = 5
   +-------+   +-------+   +-------+   +-------+   +-------+   
   |       |   |       |   |       |   |       |   |       |   
   +---+   |   +---+   |   +---+   |   +---+   |   +---+   |   
       |   |       |   |       |   |       |   |       |   |   
-------+   +-------+   +-------+   +-------+   +-------+   +
n = 4
m = 4
   +---------------+   +---------------+   +---------------+   +---------------+
   |               |   |               |   |               |   |               |
   |   +-------+   |   |   +-------+   |   |   +-------+   |   |   +-------+   |
   |   |       |   |   |   |       |   |   |   |       |   |   |   |       |   |
   |   +---+   |   |   |   +---+   |   |   |   +---+   |   |   |   +---+   |   |
   |       |   |   |   |       |   |   |   |       |   |   |   |       |   |   |
   +-------+   |   |   +-------+   |   |   +-------+   |   |   +-------+   |   |
               |   |               |   |               |   |               |   | 
---------------+   +---------------+   +---------------+   +---------------+   +
```
## Winning criteria:
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes in each language wins.
Please explain your code, if you have time to do it.
  
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~52~~ ~~34~~ 33 bytes
```
Ｎθ↶ＦＮＦ⊗⊕θ«+⊖⊗×⊕﹪κ²∨↔⁻θ∧κ⊖κ¹¿›κθ↷↶
```
[Try it online!](https://tio.run/##VU/LDoIwEDzLVzScthEP4tETiYkxESXGH@CxSENppbRcjN9eW6IRTvuYmd2ZsslVKXNu7Uk8jb6YrkAFPd0HGRulPmOtwQ21VATmDErJtDtIU3CsHFYq7FBo1/cOfAWrTDGhIVyHTv8dDvhn/ZR31uGw0KeyMlxCG5GY0ohcFSTFACkTZoA@IomoPDa/1VLqmVtf/DdWEzgqzLVz6qje0BTnxh6Nz0OQD0gWCd/W7oLYbkb@AQ "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
Ｎθ
```
Input the size of the meander.
```
↶
```
Pivot upwards as the drawing starts at the right and works left.
```
ＦＮ
```
Loop over the desired number of meanders.
```
Ｆ⊗⊕θ«
```
Loop over the segments of the meander.
```
+
```
Print a `+`.
```
∨↔⁻θ∧κ⊖κ¹
```
Compute the `k`th element of the list \$ n, n, n-1, n-2 ... 3, 2, 1, 1, 1, 2, 3, ... n \$.
```
⊖⊗×⊕﹪κ²...
```
Alternate between doubling and quadrupling the lengths since the horizontal lines are twice as long, but decrement the result before printing to take account of the `+` that was just printed.
```
¿›κθ↷↶
```
Pivot appropriately for the next segment.
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), ~~108~~ ~~101~~ 95 bytes
```
' -+|'[⊃,/⎕⍴⊂b/⍨3 1⍴⍨≢⍉b←⌽⊖2@a⌽1@(a←⊂0 0)⊖0,⊃{((4|-⊖⍉⍵),⍉¯2↑⍉⍵)⍪(2/⍪⍳2),¯2↑⍵}/⎕⍴⊂46 16 47⊤⍨3⍴4]
```
[Try it online!](https://tio.run/##rVTBTsJAEL33K/Y2rW2lLRUTT/yHeihIDbEJpngxlAsYlOoSOehd4sFw8aDEhMSLnzI/UqeAaWy7mIKbNDvz9u3s7OvMOueefnLpeK1Tve457XazHuHoodnCwb0h4c21GwHT1QAOMexrJVpC/o5hr1ZC/lJmZuzxFxxOkA9rtAfvPjF8tKoOGWZVdmIo7BnMUAg2NArSkWU70MmjHchnikbz16uFg/EKQD6VLQo/Rf5mKdrP2qybnG5XmFlh9j6Gz3EaBNrHESUrufF5fATElHd3FJpi0wfafkS5zgHDiUmpQbcDGhkftFr3wYXognZ2iIbDJ3@RdN@lHOYH0DoDvL0C12l6FGZOFL8rSQ22vBkwxlQ9GWraB6mhJdSAJSNI@1mquooYpP0sVfj9pgojZqnCPFPUdbePfZDKzCJ5x4182dSidr6kQVFbLEwhOytasElWWUHVTTQCyWJ7a8QW/alCmLim8@qlEJbfA3pO1RbG8nuG5fRMYezvzt0YW1/sW90i2wD/orP4Jdm6OsQvz9Y1vWwem9mL5vkG "APL (Dyalog Classic) – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~559 540 523 511 494 484 476 468 456 447~~ 443 bytes
```
#define S memset
l,o,p,q,r;g(c,d,n)char*d;{q=~c;for(p=n*2;q%2*p;bcopy(n*2-p--?"|   |":"+---+",d-q*l*p,5));p=n-1;c--%2?S(S(d-~l-r*!q,45,r++)-2*l,45,r=n*4-1),d[r*=q-1]='|',d[r-l]=d[r+l]=43,p&&g(c%4,memcpy(q?d+p*4+l:d-l-n*4,q?"+   |":"|   +",5),p):p&&g(c%4,d,p,d[-q]=45,d[q*=l]=43,*(d-=q*(n*2*l-l-2)-2)=32);}f(n,m){char b[(o=n-~n)*(l=n*4+5)];g(0,strcpy(S(S(b,32,l*o),45,l)+l-6,"+   +"),n);for(o*=m;b[o/m*l-1]=0,o--;o%m||puts(""))printf(b+o/m*l);}
```
[Try it online!](https://tio.run/##ZZDBbtswDIbvfQrVQ1pRItHGsXeIIOQhcgxyqKW4DSBbkpMdhrh59Yz22gFDTiR/iL@@n47enbvdfvhDe@wPYiu6Q3c6nB8CRkyYcTDv0qHHHtzH26C8uWR7daaNg0y2V6XJi1Il07iYfkueKRFtilEIMRbrQhORLtBTVkElrAEMb9HSOKJFudnKrfR0DTSox4xVjYPWQKUKc8/2FS0B/W5QNtNyb5/H52misLdcNJdqhenpiREXFTK5Y4i88TqpSoe1p0DsgXlT6C@gCYyBasAE63@bnqP6HWX2q7nJyv61Vkxns5pyqcBmJcOBXZVgPlvZYweX6Sii2cnIqa49KBkmal3Dnu/2iqfzMCFNORtclRhUhClbAB3oJ85YugC@7nzRqGxnml186fg7zvuKkcjERTeO6df5JIsCIA3H/tzKRs@vmOTGs@jejr0EcXkQopVLZMLvBTNL5b20upeqe6n@X/q8/QE "C (gcc) – Try It Online")
Slightly less golfed
```
#define S memset
l,o,p,q,r;
g(c,d,n)char*d;{
 q=~c;
 for(p=n*2;q%2*p;bcopy(n*2-p--?"|   |":"+---+",d-q*l*p,5));
 p=n-1;
 c--%2?
  S(S(d-~l-r*!q,45,r++)-2*l,45,r=n*4-1),
  d[r*=q-1]='|',
  d[r-l]=d[r+l]=43,
  p&&
   g(c%4,memcpy(q?d+p*4+l:d-l-n*4,q?"+   |":"|   +",5),p)
 :
  p&&
   g(c%4,d,p,d[-q]=45,d[q*=l]=43,*(d-=q*(n*2*l-l-2)-2)=32);
}
f(n,m){
 char b[(o=n-~n)*(l=n*4+5)];
 g(0,strcpy(S(S(b,32,l*o),45,l)+l-6,"+   +"),n);
 for(o*=m;b[o/m*l-1]=0,o--;o%m||puts(""))
  printf(b+o/m*l);
}
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~371~~ ~~354~~ ~~346~~ ~~328~~ ~~298~~ 290 bytes
```
import sys
v=sys.argv
s=int(v[1])
n=range
r="   |"
t="   +---"
h="-"*4
e=" "*4
def C(l):print(l*int(v[2]))
for i in n(-(-s//2)):q=s-i+~i;R=r*i;C(R+t+h*q+"+"+R);C(R+r+e*q+R+r)
for i in n(s//2):q=s//2-i;R=r*~-q;w=2*i+s%2;C(R+t+h*~-w+"+"+r*(q+((i>0)|s%2)));C(R+e*-~w+R+2*r)
C(h*~-s+"---+   +")
```
-20B Thanks to ceilingcat
[Try it online!](https://tio.run/##VY/BasMwDIbvfgpjKFg2Wre0uzS4l7xBrqOHwtzG0DmJbRIKJa/uyQkMhkC/@KX/Aw3P1PX@kLP7GfqQeHxGNhnqb9dwn1g0zic5fX1cgHkTrv5uWTCCc/4SLK2DRkTBOiNQqCOz5BX9tjfeyAechlAID7VxqgsAu/WBO@489xIlxv2@AjiNJqLTi6tbE5SrG9nqpDs1akHVwmoEbckg/cdYASVPilt@wbGeTaWcjrvqj7XgvNKCkqOW0p3f4UV7gI1uFS4z0StF/EaW@6gFfafLlwJyzp/58As "Python 3 – Try It Online")
Pre-golfing:
```
import sys
import math
def draw_curve(curve_size, curve_count, out=sys.stdout):
    for i in range(math.ceil(curve_size / 2)):
        for j in range(curve_count):
            out.write("   |" * i)
            out.write("   +---")
            out.write("----" * (curve_size - 2 * i - 1))
            out.write("+")
            out.write("   |" * i)
        out.write("\n")
        for j in range(curve_count):
            out.write("   |" * (i + 1))
            out.write("    " * (curve_size - 2 * i - 1))
            out.write("   |" * (i + 1))
        out.write("\n")
    for i in range(curve_size // 2):
        for j in range(curve_count):
            out.write("   |" * (curve_size // 2 - i - 1))
            out.write("   +---")
            out.write("----" * (2 * i - (0 if curve_size % 2 else 1)))
            out.write("+")
            out.write("   |" * (curve_size // 2 - i + (1 if i or curve_size % 2 else 0)))
        out.write("\n")
        for j in range(curve_count):
            out.write("   |" * (curve_size // 2 - i - 1))
            out.write("    " * (2 * i + (2 if curve_size % 2 else 1)))
            out.write("   |" * (curve_size // 2 - i + 1))
        out.write("\n")
    for j in range(curve_count):
        out.write("----" * (curve_size - 1))
        out.write("---+   +")
if __name__ == "__main__":
    draw_curve(int(sys.argv[1]), int(sys.argv[2]))
```
[Answer]
# [Dash](https://wiki.debian.org/Shell) - POSIX Shell script, 528 bytes
[Try it online!](https://tio.run/##dVPbjtowEH3nK06DJW7LLiFFiEV5QCutVIkPgJaqePEAUY2dxklXLc2309gJCd1V8xCN5xx7Zs7MCG6Ol0v7w8NLpB7MsdVC8bVxJBlTgn2mdmmkFfY6AZ0yydNIHcAVeJLwX3dIjwTJ1SHjB4LQZKB0iu9KvyJK3Vtxt3cG/eQSC3b282/sPM7DDgs689zh63BUBrUhPiNS2Br6ATbezoUukSIfQftIkQsXa2OiF1kYPE0pUebxSpKRSUNPRAm5pAc7nakUb8/39/deeWPHDYH5RczyDL@3DDtJgMxH8Rd@Zz6vkLFDphaRJT6FCBo8cLjvIwssQZS0ANYlJg3vY8mbIJtATi0vKdlT67GAmDbsScmeIZtC2pcCNNkFzlUgliBmnfIOGb6rVLOCLqygbGmlBP7f2oO2bY1UqqGIBIlGtfoeVwKxLLq7O/Kk5LohqAii6HNl4ikcXk2nscd8r1EZSPq9Vci63dXA7/XqagF59Q//9Wf93tr6147/FG7@3IDiCg7fg06Nyo7BVmDrYrLAnipn3qrLe02ilMrauIHUdszNVY2m2rtGjzgmZSE3lYafqBHNPcFNCpJ0omLoLKUzqHrkJP/UjPp50e5/4cPfX/Nt0ygIsMVVW63o1o3BO8BZ1fLS7qhdRJdxsRaKXiND9Zat69DjEYY@Rk1YC69qeITZ7CYlt8XPobfxNqxY5pVd5nW@8bz5MmTnZc7Oz49D5K03qbl0PLa0tFYNXS6X4BL8BQ "Dash – Try It Online")
golfed:
```
Y=0;p(){ eval A${1}_${2}='$3';};for Z in `seq $2`;do case $1 in 1)L='r3 u1 r3 d1';;2)L='r7 u1 l3 u1 r7 d3';;3)L='r11 u3 l3 d1 l3 u3 r11 d5';;4)L='r15 u5 l7 d1 r3 d1 l7 u5 r15 d7';;5)L='r19 u7 l11 d3 r3 u1 r3 d3 l11 u7 r19 d9'
esac;for A in $L;do d(){ C=-;case "$1" in r*)X=$((X+1));;l*)X=$((X-1));;u*)Y=$((Y+1));C=\|;;d*)Y=$((Y-1));C=\|;;esac;p $X $Y $2 $C;};for I in `seq ${A#*[a-z]}`;do d $A;done;d $A +;done;done;for Y in `seq 20 -1 0`;do for X in `seq 0 99`;do eval F="\"\$A${X}_${Y}\"";L=${L}${F:- };done;echo "$L";L=;done
```
ungolfed:
```
#!/bin/sh
# helper function for emulating an array, the language does not know it
p(){ eval A${1}_${2}='$3';}
Y=0
for Z in `seq $2`;do
 # define the possible patterns:
 # list="direction+count direction+count ..."
 case $1 in
  1)L='r3 u1 r3 d1';;
  2)L='r7 u1 l3 u1 r7 d3';;
  3)L='r11 u3 l3 d1 l3 u3 r11 d5';;
  4)L='r15 u5 l7 d1 r3 d1 l7 u5 r15 d7';;
  5)L='r19 u7 l11 d3 r3 u1 r3 d3 l11 u7 r19 d9'
 esac
 for A in $L;do
  # helper function for going into needed direction
  # and plot char into array
  d(){
   C=-
   case "$1" in
    r*)X=$((X+1));;
    l*)X=$((X-1));;
    u*)Y=$((Y+1));C=\|;;
    d*)Y=$((Y-1));C=\|;;
   esac
   p $X $Y $2 $C
  }
  # write char as long as needed into array,
  # append in the same direction as last element the '+'
  for I in `seq ${A#*[a-z]}`;do
   d $A
  done
   d $A +
  done
 done
# echo the array linewise
for Y in `seq 20 -1 0`;do
 for X in `seq 0 99`;do
  eval F="\"\$A${X}_${Y}\"";L=${L}${F:- }
 done
 echo "$L";L=
done
```
[Answer]
# [Python 2](https://docs.python.org/2/), 261 bytes
```
n,m=input()
i=0;h,v,p,s=map(tuple,'hv+ ');k=p;R=[h+s]
exec"h,v=v,h;R=zip(*R)[::-1];R=[s+R[0][:-1]+k+h+p]+[s+r+s+v for r in R[1:]]+[h*2*i+h+p+s+p];i+=1;k=v;"*n
for r in[[(3-i%2*2)*{h[0]:'-',v[0]:'|'}.get(c,c)for i,c in enumerate(l)]*m for l in R]:print''.join(r)
```
[Try it online!](https://tio.run/##NVC9bsMgEJ7DU6BIFdjgKHaiDLYY07WS1Q0xpC4tNDZGGLtNmz67C0gdOH1/dyfO3rwaTbV246tkDiG0GjowbezscQY02zeKLtTSiQ0Xi/1se0mRWghEWXNltmkZV2QSQH7JbhuibKEqiN/a4rzNeF0XpYihibR8L3ik5EoUsYIEzZGJLPBtdNBBbWDLy1oEQ@VVrmMo2FY0mrAyLFuabW7Af5hzfCj0Q5VXWf6jwuwaFYguCdzR7@5detzRLot5Tbs4Xpp5kO7iJe4zkQ9pb5/2ito6bTxCu49RG@yyNXEYbgESalIF4T7gU@lewmc3yxpsvLuFuom/h/GEIMBOWg/PT49n50YX3RcnL1eQmiGEpCgKEsE9PhBZVKO9lrQCFS3BgR7AkZ7AiR7XPw "Python 2 – Try It Online")
5 bytes from [this tip](https://codegolf.stackexchange.com/a/169511/69880) by [Esolanging Fruit](https://codegolf.stackexchange.com/users/61384/esolanging-fruit).
]