text:
ASCII clock with dot & comma time markers
Introduction

Imagine that line of chars is in fact two rows. Upper row - dots -  represents hours (24 hour system), while lower - commas - represents minutes. One character can represent hour, minute or both - whenever it's possible.
At first probably you'd have to convert minutes since midnight to hours and minutes.
The result is the string showing current time in "dot format". The dot count (apostrophe counts here as a dot and will be called so!) is the hour count since midnight and comma count is minutes count. I'll show a few examples to make it clear.

(Remark) hh:mm - result
(Only hours) 05:00 - '''''
(Only minutes) 00:08 - ,,,,,,,,
(hours < minutes) 03:07 - ;;;,,,,
(hours > minutes) 08:02 - ;;''''''
(hours = minutes) 07:07 - ;;;;;;;
(the start of the day) 00:00 -   (empty result)

Notice that "both" character can be used max 23 times - for 23:xx, where xx is 23 or more.
Symbols
If character have to (see rule 5.) be escaped in your language, you could changed it to one of alternatives. If said alternatives aren't enough, you may use other symbols - but keep it reasonable. I just don't want escaping to be a barrier.

; (semicolon) - marker for both hours and minutes (alt: :)
' (apostrophe) - marker for hours (alt: '``°)
, (comma) - marker for minutes (alt: .)

Additional rules

The code with the least amount of bytes wins!
You have to use both symbol whenever it's possible. For 02:04 the result can't be '',,,,, nor ;',,,. It have to be ;;,,
Input - can be script/app parameter, user input (like readline) or variable inside code
3.1. If the variable inside code is used, then its lenght have to be the longest possible. It's 1439 (23:59), so it would look like t=1439
The common part which is symbolized by "both" character (12 in 12:05, 3 in 03:10) must be placed on the beginning of the string
Symbols can be replaced to alternatives only if they would have to be escaped in your code.
Input is given in minutes after 00:00. You can assume that this is a non-negative integer.

Test cases
Input: 300
Output: '''''

Input: 8
Output: ,,,,,,,,

Input: 187
Output: ;;;,,,,

Input: 482
Output: ;;''''''

Input: 427
Output: ;;;;;;;

Input: 0
Output:  (empty)

No problem! It is a very good first post and a nice challenge :)

this looks so good with just semicolons and commas, but apostrophes muck it all up :(

Actually 1439 is 23:59 and not 1339. (23 x 60 + 59).

Thank all of you for good words! :) @Sparr, yeah, that's the bad point :( Have you idea how it could be replaced? insertusernamehere, of course that's right! Fixed :)

3.1 is kind of weird... What does it mean? Does the variable have to be called qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq?

+1 I love this way of represent time! Now I'll try to understand the challenge

If you use . for the hours and ' for the minutes and use a newline in between them......

@user46167 no it means you have to use the longest time value possible (a four-digit one) for the byte count

Pyth, 19 bytes
:.iF*V.DQ60J"',"J\;

Test suite
:.iF*V.DQ60J"',"J\;
      .DQ60            Divmod the input by 60, giving [hours, minutes].
           J"',"       Set J equal to the string "',".
    *V                 Perform vectorized multiplication, giving H "'" and M ','.
 .iF                   Interleave the two lists into a single string.
:               J\;    Perform a substitution, replacing J with ';'.

CJam, 22 20 19 bytes
Takes input from STDIN:
ri60md]',`.*:.{;K+}

Test it here.
Explanation
ri     e# Read input and convert to integer.
60md   e# Divmod 60, pushes hours H and minutes M on the stack.
]      e# Wrap in an array.
',`    e# Push the string representation of the comma character which is "',".
.*     e# Repeat apostrophe H times and comma M times.
:.{    e# Apply this block between every pair of characters. This will only applied to
       e# first N characters where N = min(hours,minutes). The others will remain
       e# untouched. So we want the block to turn that pair into a semicolon...
  ;    e#   Discard the comma.
  K+   e#   Add 20 to the apostrophe to turn it into a semicolon.
}

It was really lucky how well things worked together  here, in particular the assignment of hours to ' and minutes to , such that the order of hours and minutes on the stack matched up with the string representation of the character.
This is the only 3-byte block I've found so far. There were tons of 4-character solutions though:
{;;';}
{';\?}
{^'0+}
{^'F-}
{-'@+}
{-'6-}
...

GNU Sed, 37
Score includes +1 for -E option to sed.
I wasn't particularly impressed with the golfiness of my bash answer, so I thought I'd try with sed for the fun.
Input is in unary, as per this meta-answer.
y/1/,/          # Convert unary 1's to commas (minutes)
s/,{60}/'/g     # divmod by 60.  "'" are hours
:               # unnamed label
s/(.*)',/;\1/   # replace an apostrophe and comma with a semicolon
t               # jump back to unnamed label until no more replacements

Try it online

unnamed label??

@mikeserv, see Digital Trauma's related tip in Tips for golfing in sed.

@manatwork - i think it must be a GNU bug.

@mikeserv - but using bugs is OK as well, right? I'm not asking to mock you, I just don't know :)

@Krzysiu - ok? hmm. on this site i think it would be a mark of excellence. otherwise, almost definitely no. when programmers stray from API and use implementation details programs become version/implementation dependent - which is a bad thing.

@Krzysiu - by the way, i dont consider that GNU accepts the empty label : definition to be a bug, exactly, though i would expect it to throw an error without a parameter. but t's branching back to the null label is pretty buggy - it's supposed to branch out of the script when given no params. according to spec, that is.

@mikeserv Welcome to the wild-west world of PPCG! ;-) Undocumented language features are generally allowed here; encouraged even - to heck with Posix ;-).  Another one of my favourites

thats definitely how i figured it. clever and short is what the puzzles here are all about. thats why i upvoted you. the bad news is that i mean to report it, and hopefully it will get fixed. that would be an ugly bug to get caught up with.

I don't understand why  1 in first line (instead of space, this will permit to whipe out your ugly yes 1 | head in your sample and replace them by simple printf %$1s for sample...)

@F.Hauri Typically unary numbers are expressed as a string of 1s.

Python 2, 56 bytes
def g(t):d=t%60-t/60;print(t/60*";")[:t%60]+","*d+"'"*-d

A function that prints (one char shorter than t=input();).
The method is similar to Loovjo's. The number of , is the different between minutes and hours, with an implicit minimim of 0. For ', it's the negation. For ;, computes the min implicitly by taking as many ; as hours, then truncating to the number of minutes.
It saves chars to save d, but not the number of hours and minutes here. The analogue with lambda was two chars longer (58), so the variable assignments are worth it.
lambda t:(t%60*";")[:t/60]+","*(t%60-t/60)+"'"*(t/60-t%60)

Processing the input directly didn't save chars either (58):
h,m=divmod(input(),60);d=m-h;print(";"*m)[:h]+","*d+"'"*-d

Another strategy with slicing, much longer (64):
def g(t):m=t%60;h=t/60;return(";"*m)[:h]+(","*m)[h:]+("'"*h)[m:]

Pure Bash (no external utilities), 103
p()(printf -vt %$2s;printf "${t// /$1}")
p \; $[h=$1/60,m=$1%60,m>h?c=m-h,h:m]
p , $c
p \' $[m<h?h-m:0]

Thanks to @F.Hauri for saving 2 bytes.

Nice! But you could save 2 chars by swapping $1 and $2 in p() and write p , $c at line 3.

Yes, but as it's used only in a printf "%s", having c empty will work fine (while not reused)

@F.Hauri Now I get it - thanks!

Retina, 24
Trivial port of my sed answer.
Input is in unary, as per this meta-answer.
1
,
,{60}
'
+`(.*)',
;$1

Try it online.

C, 119 bytes
#define p(a,b) while(a--)putchar(b);
main(h,m,n){scanf("%d",&m);h=m/60;m%=60;n=h<m?h:m;h-=n;m-=n;p(n,59)p(h,39)p(m,44)}

Detailed
// macro: print b, a times
#define p(a,b) while(a--)putchar(b)

int main(void)
{
    int h,m,n;
    scanf("%d",&m);  // read input

    h=m/60;m%=60;    // get hours:minutes
    n=h<m?h:m;       // get common count
    h-=n;m-=n;       // get remaining hours:minutes

    p(n,59);        // print common
    p(h,39);        // print remaining hours
    p(m,44);        // print remaining minutes

    return 0;
}

Using putchar & integer literals as characters saves one byte, pulling the semicolons inside the macro saves two more :)

@Quentin note taken, saved 5 bytes

You can lose the space before your while in your #define macro. -1 byte

You can also save some more bytes by just making p(a,b) a function instead of a macro. (And sprinkling a few more semi-colons to your main function)

Haskell, 68 66 Bytes
g(h,m)=id=<<zipWith replicate[min h m,h-m,m-h]";',"
g.(`divMod`60)

Usage example:
(g.(`divMod`60)) 482

The clever bit here is that replicate will return the empty string if the length given is negative or zero so I can apply it to both differences and only the positive one will show up. The first part is easy, since the number of semicolons is just the minimum of the two. Then zipWith applies the function to the corresponding items.
EDIT: Realized I was using the wrong char for minutes
EDIT 2: Saved 2 bytes thanks to @Laikoni

You can save two bytes by replacing concat$ with id=<<.

JavaScript (ES6) 69
m=>";".repeat((h=m/60|0)>(m%=60)?m:h)+",'"[h>m|0].repeat(h>m?h-m:m-h)

Powershell, 99 85 bytes
param($n)";"*(($m=$n%60),($h=$n/60))[($b=$m-gt$h)]+"'"*(($h-$m)*!$b)+","*(($m-$h)*$b)
Using Loovjo's method, this is my powershell implementation.
ungolfed
param($n)
# set the number of minutes and hours, and a boolean which one is bigger
# and also output the correct number of ;s
";"*(($m=$n%60),($h=$n/60))[($b=$m-gt$h)]+
# add the difference between h and m as 's but only if h > m
"'"*(($h-$m)*!$b)+
# add the difference between m and h as ,s but only if m > h
","*(($m-$h)*$b)

Saved 14 bytes thanks to AdmBorkBork

You can save by using a pseudo-ternary for the first one, moving the $m and $h declarations into it, and then using Boolean multiplication. Like so -- param($n)';'*(($m=$n%60),($h=$n/60))[($b=$m-gt$h)]+'°'*(($h-$m)*!$b)+','*(($m-$h)*$b)

Python 3, 98 bytes
d=int(input());m=d%60;h=int((d-m)/60)
if m>=h:print(";"*h+","*(m-h))
else:print(";"*(m)+"'"*(h-m))

Probably not the best answer, but it was a lot of fun!

Python 2, 61 bytes
t=input();m,h=t%60,t/60
print";"*min(h,m)+","*(m-h)+"'"*(h-m)

Explaination:
t=input();              # Read input
          m,  t%60,     # Do a divmod, h = div, m = mod
            h=     t/60

print";"*min(h,m)+                    # Print the minimum of the h and m, but in ";"s
                  ","*(m-h)+          # Print (m-h) ","s (if m-h is negative, print nothing)
                            "'"*(h-m) # Print (h-m) "'"s (if h-m is negative, print nothing)

PHP, 81 bytes
I went for the variable input as it is shorter than reading from STDIN or taking command line arguments.
for($_=1439;$i<max($h=0|$_/60,$m=$_%60);++$i)echo$i<$h?$i<min($h,$m)?';':"'":",";

I thought that I know PHP rather well, but I see | for the first time. I think I'll use it to exercise a bit - I'll analyze it :)

Fails for 240. Try $i>=min($h,$m)?$h<$m?",":"'":";" (+1 byte). Or use for($_=1439;$i<max($h=0|$_/60,$m=$_%60);)echo"',;"[$i++<min($h,$m)?2:$h<$m]; (76 bytes). Btw: single quote renders -r impossible; so you should use backtick for hours if in a string or ° standalone (needs no quotes -> -1 byte).

JavaScript (ES6), 77 71 bytes
x=>';'[r='repeat'](y=Math.min(h=x/60|0,m=x%60))+"'"[r](h-y)+','[r](m-y)

Great use of assignments in attribute access/function arguments. +1

Perl 6, 103 101 98 97 69 bytes
$_=get;say ";"x min($!=($_-$_%60)/60,$_=$_%60)~"'"x $!-$_~","x $_-$!;

Outputs several arrays, but fuck it, enjoy.
As usual, any golfing oppertunities are appericated.
Edit: -2 bytes: got brave and removed some casts.
Edit2: -3 bytes by removing the arrays.
Edit3: -1 byte to print in right format, using "lambdas" and removing parantheses.
Edit4: (sorry guys) abusing that hours - minutes should return 0 and the opposite. Removed if statements. Then removing brackets, then realising i didnt need the lambda at all. -28 bytes :)
Woah im getting better at this.

C, 141 bytes
main(h,m){scanf("%d",&m);h=(m/60)%24;m%=60;while(h||m){if(h&&m){printf(";");h--;m--;}else if(h&&!m){printf("'");h--;}else{printf(",");m--;}}}

I think you could save a few bytes by using h>0||m>0. Then you need to h--;m--; only once in every iteration and the {} for if/else would get obsolete.

You can also save a few bytes on your second conditional: instead of else if(h&&!m) you can just have else if(h)

And finally try to use the ternary operator, it will save you from using "long" words like if and else.

Consider refactoring as a function that takes the input as an int parameter - that should at least save you the scanf().

I don't think the %24 is necessary - max input is 23:59.

Ruby, 50 characters
->t{(?;*h=t/60)[0,m=t%60]+",',"[0<=>m-=h]*m.abs}

Thanks to:

G B for

reminding me that I can't take more characters from a string than it has (-1 character)
reorganizing my calculation (-1 character)

Waited so long to use Numeric.divmod, just to realize that its horribly long.
Sample run:
2.1.5 :001 > puts ->t{(?;*h=t/60)[0,m=t%60]+",',"[0<=>m-=h]*m.abs}[252]
;;;;,,,,,,,,

Save 1 character by truncating the string instead of using min: (?;*h=t/60)[0,m=t%60]

And another byte by subtracting h from m: ",',"[0<=>m-=h]*m.abs

Gema, 119 characters
<D>=@set{h;@div{$0;60}}@set{m;@mod{$0;60}}@repeat{@cmpn{$h;$m;$h;$h;$m};\;}@repeat{@sub{$h;$m};'}@repeat{@sub{$m;$h};,}

Sample run:
bash-4.3$ gema '<D>=@set{h;@div{$0;60}}@set{m;@mod{$0;60}}@repeat{@cmpn{$h;$m;$h;$h;$m};\;}@repeat{@sub{$h;$m};`}@repeat{@sub{$m;$h};,}' <<< '252'
;;;;,,,,,,,,

Matlab: 89 bytes
i=input('');m=mod(i,60);h=(i-m)/60;[repmat(';',1,min(h,m)),repmat(39+5*(m>h),1,abs(h-m))]

Test:
310
ans =
;;;;;,,,,,

SmileBASIC, 59 bytes
INPUT M
H%=M/60M=M-H%*60?";"*MIN(H%,M);",'"[M<H%]*ABS(H%-M)

Explained:
INPUT MINUTES 'input
HOURS=MINUTES DIV 60 'separate the hours and minutes
MINUTES=MINUTES MOD 60
PRINT ";"*MIN(HOURS,MINUTES); 'print ;s for all positions with both
PRINT ",'"[MINUTES<HOURS]*ABS(HOURS-MINUTES) 'print extra ' or ,

It looks pretty terrible, since the bottom part of ; is not even the same as , in SmileBASIC's font

Java 8, 101 99 86 bytes
n->{String r="";for(int m=n%60,h=n/60;h>0|m>0;r+=h--*m-->0?";":h<0?",":"'");return r;}

Explanation:
Try it here.
n->{                      // Method with integer parameter and String return-type
  String r="";            //  Result-String (starting empty)
  for(int m=n%60,h=n/60;  //   Get the minutes and hours from the input integer
      h>0|m>0;            //   Loop as long as either the hours or minutes is above 0
    r+=                   //   Append the result-String with:
       h--*m-->0?         //    If both hours and minutes are above 0
                          //    (and decrease both after this check):
        ";"               //     Use ";"
       :h<0?              //    Else-if only minutes is above 0 (hours is below 0)
        ","               //     Use ","
       :                  //    Else:
        "'"               //     Use "'"
  );                      //  End loop
  return r;               //  Return the result
}                         // End of method

PHP, 81 bytes
some more solutions:
echo($r=str_repeat)(";",min($h=$argn/60,$m=$argn%60)),$r(",`"[$h>$m],abs($h-$m));
// or
echo($p=str_pad)($p("",min($h=$argn/60,$m=$argn%60),";"),max($h,$m),",`"[$h>$m]);

Run with echo <time> | php -R '<code>'.
<?=($r=str_repeat)(";",min($h=($_=1439)/60,$m=$_%60)),$r(",`"[$h>$m],abs($h-$m));
// or
<?=($r=str_repeat)(";",min($h=.1/6*$_=1439,$m=$_%60)),$r(",`"[$h>$m],abs($h-$m));
// or
<?=str_pad(str_pad("",min($h=($_=1439)/60,$m=$_%60),";"),max($h,$m),",`"[$h>$m]);

Replace 1439 with input, save to file, run.

05AB1E, 25 bytes
60‰vy„'.Nè×}‚.BøJ„'.';:ðK

Try it online!
60‰vy„'.Nè×} can definitely be shortened, I just couldn't figure it out, and doubt I'll be able to shave off 7 bytes to win with this approach unless there's a vectored version of ×.

Example (With input equal to 63):
60‰                       # Divmod by 60.
                          # STACK: [[1,3]]
   vy      }              # For each element (probably don't need the loop)...
                          # STACK: []
     „'.Nè×               # Push n apostrophe's for hours, periods for minutes.
                          # STACK: ["'","..."]
            ‚             # Group a and b.
                          # STACK: [["'","..."]]
             .B           # Boxify.
                          # STACK: [["'  ","..."]]
               ø          # Zip it (Transpose).
                          # STACK: [["'."," ."," ."]
                J         # Join stack.
                          # STACK: ["'. . ."]
                 „'.';:   # Replace runs of "'." with ";".
                          # STACK: ["; . ."]
                       ðK # Remove all spaces.
                          # OUTPUT: ;..

D60÷''×s60%'.×‚.BøJ„'.';:ðK was my original version, but that's even MORE costly than divmod.
60‰WDµ';ˆ¼}-¬0Qi'.ë''}Z×¯ìJ yet another method I tried...

dc, 95 bytes
[60~sdsp39sj]sd[60~spsd44sj]se?ddd60~<d60~!<e[59Plp1-spld1-dsd0<y]syld0<y[ljPlp1-dsp0<y]sylp0<y

Try it online!

///, 49 bytes
/x/1111111111//xxxxxx/o//oo1/o1o//o1/;//o/'//1/,/

Try it online!
The first two substitutions, /x/1111111111//xxxxxx/o/, replace sequences of 60 1s with an o.
/oo1/o1o/ interweaves the 1s into the os, which are next to each other.
Ex. oooooo1111111111 -> o1o1o1o1o1o11111
This pairs each o, which is one hour, with one 1, which is minute. This also pushes the 1s to the left, so whichever one is greater is left at the right.
o1/;/ replaces each pair with a ;
/o/'/ /1/1/ and this converts the leftovers to :s or 's

Jelly, 13 bytes
d60Ø½ẋ"Sị“',;

Try it online!
Explanation
d60Ø½ẋ"Sị“',;   Main monadic link
d60             Divmod by 60
      "         Zipmap
   Ø½             [1, 2]
                  with that
     ẋ            using the “repeat n times” operator
       S        Sum
        ị       Index into
         “',;   "',;"

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Help Trump build the wall!
Trump needs the wall constructed and you are going to do it! To most efficiently build his wall I have created a simple, repeatable pattern for you to use:
    __   __
   |  |_|  |
___|       |___
-   -   -   -
 - - - - - - -
- - - - - - - -
———————————————

Trump will tell you how many wall segments he needs and you will build them to look just like this.
Here is the pattern:
    __   __     <-- 4-2-3-2-4          ' _ _ '
   |  |_|  |    <-- 3-1-2-1-1-1-2-1-3  ' | |_| | '
___|       |___ <-- 3-1-7-1-3          '_| |_'
-   -   -   -   <-- 1-3-1-3-1-3-1-1    '- - - - '
 - - - - - - -  <-- 1-1-...-1-1        ' - -...- - '
- - - - - - - - <-- 1-1-...-1-1        '- - ... - -'
——————————————— <-- 15                 Unicode U+2014

Input will always be an integer >0.
Test cases:
1
    __   __
   |  |_|  |
___|       |___
-   -   -   -
 - - - - - - -
- - - - - - - -
———————————————

2
    __   __        __   __
   |  |_|  |      |  |_|  |
___|       |______|       |___
-   -   -   -  -   -   -   -
 - - - - - - -  - - - - - - -
- - - - - - - -- - - - - - - -
——————————————————————————————

5
    __   __        __   __        __   __        __   __        __   __
   |  |_|  |      |  |_|  |      |  |_|  |      |  |_|  |      |  |_|  |
___|       |______|       |______|       |______|       |______|       |___
-   -   -   -  -   -   -   -  -   -   -   -  -   -   -   -  -   -   -   -
 - - - - - - -  - - - - - - -  - - - - - - -  - - - - - - -  - - - - - - -
- - - - - - - -- - - - - - - -- - - - - - - -- - - - - - - -- - - - - - - -
———————————————————————————————————————————————————————————————————————————

Since you need to do this fast, write the shortest program possible!
If it helps, I wrote the challenge first, title last ;)

05AB1E, 38 bytes
•4H’*»È%f·ù„áÅ'4•4B3ÝJ"_ -|"‡8ô€ûvy¹×»

Try it online!
•4H’*»È%f·ù„áÅ'4•     # Push '1724427993555739020619095486300160'
4B                    # Convert to base 4 (turns it into an 8x8 bitmap).
  3ÝJ"_ -|"‡          # Replace digits 0-3 with _, , -, or |.
            8ô        # Split into pieces of 8.
              €û      # Palindromize each piece.
                vy¹×» # For each row, dupe it n times (hori) and print it.

1724427993555739020619095486300160 converted to base-4:
11110011111311300003111121112111121212122121212100000000
11110011111311300003111121112111121212122121212100000000 with characters replaced:
__     |  |____|    -   -    - - - -- - - - ________
Previous pattern split into 8 pieces:
    __
   |  |_
___|
-   -
 - - - -
- - - -
________

Then you palindromize, and make it as long as needed through repetition.

CJam, 52 bytes
F,ri*"s@;b6(MBZF,fu"128b6b"_
|-—"f=N/ff=zN*

Includes a bunch of unprintable ASCII characters. The hexdump of the first string literal pushed is:
01 73 06 40 3B 62 36 28 1E 4D 07 42 5A 14 1B 46 2C 66 75

Try it here!
Explanation
The above hexdump is interpreted as a base-128 number, then converted to base 6, to get this list:
[1 1 1 1 0 0 1 1 1 0 0 2
 1 1 1 3 1 1 3 0 3 1 1 3 2
 0 0 0 3 1 1 1 1 1 1 1 3 2
 4 1 1 1 2
 1 4 2
 4 1 2
 5]

To this, we apply the mapping 0 → _, 1 → space, 2 → \n, 3 → |, 4 → -, 5 → —. This gets us the string:
    __   __
   |  |_|  |
___|       |
-
 -
-
—

It consists of the "period" of each line; i.e. we can cycle the fifth line " -" to get " - - - - - - - ".
Then, we execute this subprogram:
N/               Split into lines.
  Ff*            Repeat each line 15 times (to cycle it).
     Ff<         Take the first 15 chars of each line.
        rif*     Repeat these chars input() times.
            N*   Join lines.

(The new version does this in a slightly different way that I actually can't wrap my head around myself very well, because it uses ff=.)

What is this I don't even

Was this language especially made for this answer?

@ErdalG. No. Though CJam was indeed made by a PPCG regular (aditsu), it's been around for quite some time. You'll find it all over the site. :)

@AlexA. Ok make more sense now. I'm quite new here, thanks! :)

@ErdalG. My pleasure. Welcome to the site!

JavaScript (ES6), 116 115 bytes
n=>"__   __    n|  |_|  |   n|       |___n -  n- n -n—".split`n`.map(l=>l.repeat(15).slice(-15).repeat(n)).join`
`

Saved a byte thanks to @Neil!
Explanation
Pretty much the same as @Mauris' CJam method, but without the character mapping.
The wall parts are in the format:
__   __
|  |_|  |
|       |___
 -
-
 -
—

because if you repeat each line 15 times you get:
...    __   __    __   __    __   __
... |  |_|  |   |  |_|  |   |  |_|  |
... |       |___|       |___|       |___
 -   -   -   -   -   -   -   -   -   -
          - - - - - - - - - - - - - - -
           - - - - - - - - - - - - - - -
                         ———————————————

and after slicing to just the last 15 characters you get:
    __   __
   |  |_|  |
___|       |___
-   -   -   -
 - - - - - - -
- - - - - - - -
———————————————

Ungolfed
n=>

  // array of wall line parts
  "__   __    n|  |_|  |   n|       |___n -  n- n -n—".split`n`

  .map(l=>       // for each wall line
    l.repeat(15) // repeat the line 15 times to create a complete wall line
    .slice(-15)  // each wall piece is only 15 characters long
    .repeat(n)   // repeat the wall n times
  )
  .join`
`                // output the resulting wall

Test

var solution = n=>"__   __    n|  |_|  |   n|       |___n -  n- n -n—".split`n`.map(l=>l.repeat(15).slice(-15).repeat(n)).join`
`
<input type="number" oninput="result.textContent=solution(+this.value)" />

Can you save a byte by using .slice(-15) instead?

Fix is easy, just use the right minimum part instead of the left minimum part: __   __    n|  |_|  |   n|       |___n -  n- n -n—

Very clever, nice job!

@Neil Ah, you're right. Thanks for the tip!

Jolf, 135 bytes
Considerable golfing can be done. Turn off pretty print and clear the output for a better result. Try it here!. Also, use this to test an arbitrary number with more ease.
oHpAt++++++++++++*"    __   __    "jH*"   |  |_|  |   "jH*"___|       |___"jH*j"-   -   -   -  "H*+*" -"7' jH*"- - - - - - - -"jH*M35j'—

I will add an explanation later.

@Connor O'Brien so what is the eta looking like on that explanation :D

Haskell, 116 118 108 bytes
h n=take(n*15).cycle
f n=unlines$h n.h 1<$>lines"    __   __\n   |  |_|  |\n___|       |\n-   \n -\n- \n—"

Usage example:
*Main> putStr $ f 3
    __   __        __   __        __   __
   |  |_|  |      |  |_|  |      |  |_|  |
___|       |______|       |______|       |___
-   -   -   -  -   -   -   -  -   -   -   -
 - - - - - - -  - - - - - - -  - - - - - - -
- - - - - - - -- - - - - - - -- - - - - - - -
—————————————————————————————————————————————

This uses the same strategy as other answers here: each line of the wall is one cycle of the pattern, e.g. "- " (dash + space) for the second last line. Repeat each pattern, take 15 chars to get one wall segment, repeat again and take 15*n chars for n segments.
Edit: @Mauris found 10 bytes. Thanks!

The bottom line should be — (U+2014), not an ASCII dash; I think this means you lose 2 bytes.

@Mauris: you're right. Fixed it. Thanks for finding out.

You can actually terminate the periods for lines 1-3 earlier, saving 4+3+3 bytes. (My CJam answer does the same thing.)

@Mauris: ah yes, because the first cycle is cut off after 15 chars. Thanks!

Bash + Linux utilities (247 186 180 bytes)
read x
for i in {1..7}
do
tail -n +7 $0|gzip -dc|sed -nr "$i s/(.*)/$(printf '\\1%.0s' $(seq 1 $x))/p"
done
exit
ˈ ELzVSPPPȏǑ
\@\Dk>ĄÚ ܋ɀÜ@r²uٞ5L! ͠

Since unprintable characters have been generously used in the construction of the above script, here's a hexdump:
00000000  72 65 61 64 20 78 0a 66  6f 72 20 69 20 69 6e 20  |read x.for i in |
00000010  7b 31 2e 2e 37 7d 0a 64  6f 0a 74 61 69 6c 20 2d  |{1..7}.do.tail -|
00000020  6e 20 2b 37 20 24 30 7c  67 7a 69 70 20 2d 64 63  |n +7 $0|gzip -dc|
00000030  7c 73 65 64 20 2d 6e 72  20 22 24 69 20 73 2f 28  ||sed -nr "$i s/(|
00000040  2e 2a 29 2f 24 28 70 72  69 6e 74 66 20 27 5c 5c  |.*)/$(printf '\\|
00000050  31 25 2e 30 73 27 20 24  28 73 65 71 20 31 20 24  |1%.0s' $(seq 1 $|
00000060  78 29 29 2f 70 22 0a 64  6f 6e 65 0a 65 78 69 74  |x))/p".done.exit|
00000070  0a 1f 8b 08 00 45 4c 7a  56 02 03 53 50 50 50 88  |.....ELzV..SPPP.|
00000080  8f 87 11 0a 5c 40 5c 03  44 f1 35 60 5a 81 2b 3e  |....\@\.D.5`Z.+>|
00000090  1e c4 04 83 1a 20 9b 4b  17 c8 40 c2 5c 40 02 19  |..... .K..@.\@..|
000000a0  72 a1 72 75 b9 1e 35 4c  21 1e 01 00 f3 30 f0 f9  |r.ru..5L!....0..|
000000b0  8d 00 00 00                                       |....|
000000b4

PowerShell, 103 100 characters (105 bytes on disk, 102 w/o BOM)
Pretty much the same as @user81655 method.
Param($c)'    __   __n   |  |_|  |n___|       |n-   n -n- n—'-split'n'|%{($_*15).Substring(0,15)*$c}

Ungolfed version
# Assign input to variable,
Param($c)

# Split array of wall parts and send them down the pipeline
'    __   __n   |  |_|  |n___|       |n-   n -n- n—' -split 'n' |
    ForEach-Object { # For each piece of wall
        ($_*15) # Repeat the line 15 times to create a complete wall line
        .Substring(0,15) # Each wall piece is only 15 characters long
        *$c # Repeat the wall n times
    }

Usage example
PS> .\TrumpWall.ps1 3
    __   __        __   __        __   __
   |  |_|  |      |  |_|  |      |  |_|  |
___|       |______|       |______|       |___
-   -   -   -  -   -   -   -  -   -   -   -
 - - - - - - -  - - - - - - -  - - - - - - -
- - - - - - - -- - - - - - - -- - - - - - - -
—————————————————————————————————————————————

97 bytes: param($c);'    __   __n   |  |_|  |n___|       |n-   n -n- n—'-split'n'|%{-join($_*15)[0..14]*$c}

PHP 5.4, ( 182 175 characters )
foreach(['    __   __    ','   |  |_|  |   ','___|       |___','-   -   -   -  ', ' - - - - - - - ','- - - - - - - -','———————————————'] as$d)echo str_repeat($d,$argv[1])."\n";

Ungolfed Version
$s=['    __   __    ',
    '   |  |_|  |   ',
    '___|       |___',
    '-   -   -   -  ',
    ' - - - - - - - ',
    '- - - - - - - -',
    '———————————————'
];
foreach($s as $d) {
    echo str_repeat($d,$argv[1])."\n";
}

[ 7 characters saved by follow Blackhole suggestion. ]
Another version with less bytes but more characters
PHP 5.4, ( 176 characters, 178 bytes )
foreach(['    __   __    ','   |  |_|  |   ','___|       |___','-   -   -   -  ',' - - - - - - - ','- - - - - - - -',str_repeat('—',15)] as$d)echo str_repeat($d,$argv[1])."\n";

Just replace 15 instances of m-dash with one dash with str_repeat function

Don't define a variable for $s, use it directly in your loop: foreach([…,…] as $d) 2) Remove the unless space before $d: foreach(… as$d) 3) Use a newline instead of "\n".

You sir are not portraying the truth. Your code amounts 182 characters, but 212 bytes.

@MichaelDibbets, Sorry confused about bytes vs characters, modified

use something like https://mothereff.in/byte-counter to count the bytes

C, 148 bytes
#define q 16843009
i;p[]={-1,q*17,q*68,q*16,-8388417,8577152,3936000};
f(n){for(i=n*105;i--;i%(15*n)||puts(""))putchar(" -|_"[p[i/15/n]>>i%15*2&3]);}

Score excludes the unnecessary newline before f(n) which is included for clarity.
the magic numbers in p encode the characters for the wall in base 4, which are reconstructed from the string " -|_" 0,1,2,3 respectively
16843009 in hex is 0x1010101. this is used for the lines with - in them.
Because _ is encoded by 3, the bottom line can be encoded simply as -1, which is the number with all the bits set to 1.

Nice but you can save 3 bytes by not using #define q and just hardcoding the values.

136 bytes

Python 3, 132 122 120 bytes
def f(n):[print((s*15*n)[:15*n])for s in['    __   __    ','   |  |_|  |   ','___|       |___','-   ', ' -', '- ', '—']]

Ungolfed:
def f(n):
    [print((s*15*n)[:15*n])for s in['    __   __    ',
                                    '   |  |_|  |   ',
                                    '___|       |___',
                                    '-   ',
                                    ' -',
                                    '- ',
                                    '—']]

You can remove the spaces to get )for s in[ ...

Python 2, (161 characters, 191 bytes)
x=input();a=['    __   __    ','   |  |_|  |   ','___|       |___','-   -   -   -  ',' - - - - - - - ','- - - - - - - -','———————————————']
for i in a:print i*x

Vitsy, 121 bytes
How I do this is by accessing each line one at a time input times, giving me stacks with the contents of each line. Then, I output a line at a time. If anyone wants me to give a more in-depth explanation, just ask (I'm currently opening presents, so...).
V0v7\[v1+v&V\[vDvm]a]y\[?Z]
"    __   __    "
"   |  |_|  |   "
"___|       |___"
4\["-   "]Xr
6mXr" "
8\["- "]X
"—"e\D
Try it online!

PHP5.5, 182 172 bytes 168 bytes
based on @kuldeep.kamboj's answer, which is actually 212 bytes the moment I write this but 182 characters.
I wish the wall was a bit higher, then I could do some more optimisation ;-)
this one is 168 bytes, thanks to @JörgHülsermann
$r='str_repeat';$d=$r(' -',7);$x='   ';foreach(["$x __   __ $x","$x|  |_|  |$x","___|$x$x |___","-$x-$x-$x-  ","$d ","-$d",$r('—',15)] as$z){echo$r($z,$argv[1])."
";}

This one is 172 bytes
$r='str_repeat';$d=$r(' -',7);$x=$r(' ',3);foreach(["$x __   __ $x","$x|  |_|  |$x","___|$x$x |___","-$x-$x-$x-  ","$d ","-$d",$r('—',15)] as$z){echo$r($z,$argv[1])."
";}

This one is 182 bytes :-)
$r='str_repeat';$d=$r(' -',7);$x=$r(' ',4);foreach([$x.'__   __'.$x,'   |  |_|  |   ','___|       |___','-   -   -   -  ',$d.' ','-'.$d,$r('—',15)] as$z){echo $r($z,$argv[1]).'
';}

ungolfed version
$r='str_repeat';
$d=$r(' -',7);
$x=$r(' ',3);
$s=["$x __   __ $x",
    "$x|  |_|  |$x",
    "___|$x$x |___",
    "-$x-$x-$x-  ",
    "$d ",
    "-$d",
    $r('—',15)
];
foreach($s as $z) {
  echo$r($z,$argv[1])."
";
}

remove the space before the as and remove the brackets -3 Bytes

$x=$r(' ',3); can be shorten to $x='     ';

You do not need the brackets for the foreach loop and  as$z could write as as$z

Vim, 90 keys
Assuming the input is in a buffer by itself the following will do the job (newline only for readability)
"aDi    __   __    ^M   |  |_|  |   ^M___|       |___^M^[
4i-   ^[xo-^[Y7P8JY2PxA ^[GVr^K-M^Vgg$d@aP

where ^M is a return, ^[ is escape, ^K is ctrl+k and ^V is ctrl+v.
This can very likely be golfed down quite a bit, as there might be much better ways of generating the pattern.

SOGL V0.12, 32 bytes
→↔\ιδ»►℮⁰}▒║ΙOģΠp~⁵‘ ¾“ζ'¹*+'¹n*

Try it Here!
Explanation:
...‘ ¾“ζ'¹*+'¹n*
...‘              push a string of the top 6 lines of 1 wall piece (no newlines)
     ¾“           push 8212
       ζ          convert to char from unicode codepoint
        '¹*       repeat 15 times
           +      add that to the previous compressed string
            '¹n   split into lines with length 15
               *  repeat horizontally input times

goes back to all ascii-art questions and upvotes dzamia for beating me on literally all of them with SOGL at some point

Java 11, 236 235 231 229 bytes
n->{String w[]={"","","","","","",""},t="- ".repeat(7);for(;n-->0;w[0]+="x __x__x ",w[1]+="x|  |_|  |x",w[2]+="___|xx |___",w[3]+="-x-x-x-  ",w[4]+=" "+t,w[5]+=t+"-")w[6]+="_".repeat(15);return"".join("\n",w).replace("x","   ");}

Try it online.
NOTE: Java 11 isn't on TIO yet, so String.repeat(int) has been emulated with repeat(String,int) (for the same byte-count).
Explanation:
n->{                                // Method with integer parameter and String return-type
  String w[]={"","","","","","",""},//  Start with seven empty rows
         t="- ".repeat(7);          //  Temp String to reduce bytes
  for(;n-->0;                       //  Loop `n` amount of times:
    w[0]+="x __x__x ",              //   Append to the first row
    w[1]+="x|  |_|  |x",            //   Append to the second row
    w[2]+="___|xx |___",            //   Append to the third row
    w[3]+="-x-x-x-  ",              //   Append to the fourth row
    w[4]+=" "+t,                    //   Append to the fifth row
    w[5]+=t+"-")                    //   Append to the sixth row
    w[6]+="_".repeat(15);           //   Append to the seventh row
  return"".join("\n",w)             //  Join all rows by new-lines
          .replace("x","   ");}     //  Then replace all "x" with three spaces,
                                    //  and return the result

Powershell + file, 92 bytes
save powershell to get-trumpwall.ps1 (40 bytes)
param($c);gc f|%{-join($_*15)[0..14]*$c}

save data file with name f and data contains Unicode symbol and Linux LF only (52 bytes):
    __   __
   |  |_|  |
___|       |
-
 -
-
—

hex dump:
0000000000: 20 20 20 20 5F 5F 20 20 │ 20 5F 5F 0A 20 20 20 7C      __   __◙   |
0000000010: 20 20 7C 5F 7C 20 20 7C │ 0A 5F 5F 5F 7C 20 20 20    |_|  |◙___|
0000000020: 20 20 20 20 7C 0A 2D 20 │ 20 20 0A 20 2D 0A 2D 20      |◙-   ◙ -◙-
0000000030: 0A E2 80 94             │                          ◙—››

Usage example
PS> .\get-trumpwall.ps1 5
    __   __        __   __        __   __        __   __        __   __
   |  |_|  |      |  |_|  |      |  |_|  |      |  |_|  |      |  |_|  |
___|       |______|       |______|       |______|       |______|       |___
-   -   -   -  -   -   -   -  -   -   -   -  -   -   -   -  -   -   -   -
 - - - - - - -  - - - - - - -  - - - - - - -  - - - - - - -  - - - - - - -
- - - - - - - -- - - - - - - -- - - - - - - -- - - - - - - -- - - - - - - -
———————————————————————————————————————————————————————————————————————————

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
D&D point buy cost
When making a Dungeons & Dragons character, an alternative to rolling ability scores is to assign them within a power budget called point buy. Higher ability scores cost more points, especially towards the upper end: a score of 8 is free, and raising a score by 1 costs 1 point, except raising to 15 or 16 costs 2 points, and raising to 17 or 18 costs 3 points.
+-------+------+
| Score | Cost |
+-------+------+
|     8 |    0 |
|     9 |    1 |
|    10 |    2 |
|    11 |    3 |
|    12 |    4 |
|    13 |    5 |
|    14 |    6 |
|    15 |    8 |
|    16 |   10 |
|    17 |   13 |
|    18 |   16 |
+-------+------+

In list form:
[(8, 0), (9, 1), (10, 2), (11, 3), (12, 4), (13, 5), (14, 6), (15, 8), (16, 10), (17, 13), (18, 16)]

The point buy cost is summed for all six ability scores.
Ability scores: 16   17   8  13   8  12
Point buy cost: 10 + 13 + 0 + 5 + 0 + 4  = 32

Given six ability scores, each 8 through 18, output the total point buy cost. Fewest bytes wins.

    var QUESTION_ID=67472,OVERRIDE_USER=20260;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/67472/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
    body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
     <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

**Leaderboard:**

Ähm is it just me or is the given challange missing? 0o

@Zaibis Not sure what you mean. I put in "fewest bytes wins" -- did you mean that?

tmp blah blah to say: yep

JavaScript (ES7), 44 42 40 bytes
Crossed out 44 is still regular 44 :(
a=>a.map(s=>t+=s-9-~((s-14)**1.3),t=0)|t

Thanks to @apsillers for saving 2 bytes!
Explanation
The interesting part is -1-~((s-14)**1.3). (s-14)**1.3 produces 1, 2, 4 and 6 for the values 15 - 18. Any number that is less than 15 causes an error because the JavaScript implementation of exponential cannot operate on negative values with a fractional exponent. Basically, any value for s < 15 causes it to return NaN, so the -1-~ is there to cast it to a number (0).
a=>                       // a = input scores as an array of numbers
  a.map(s=>               // for each passed score
    t+=                   // add to the total
      s-9                 // point value = s - 8 (-1 used for next line)
      -~((s-14)**1.3),    // add extra points for scores 15 - 18
    t=0                   // t = total points (this happens BEFORE the map call)
  )
  |t                      // return the total points

ES6 Solution (42 bytes)
a=>a.map(s=>t+=s-9-~[1,2,4,6][s-15],t=0)|t

Test
This test uses Math.pow instead the exponential operator (**) so that it can run in any standard browser.

var solution = a=>a.map(s=>t+=s-9-~Math.pow(s-14,1.3),t=0)|t
Scores separated by spaces = <input type="text" id="input" value="16 17 8 13 8 12" />
<button onclick="result.textContent=solution(input.value.split(' '))">Go</button>

One more byte: use |t instead of &&t. The ECMAScript operation ToInt32 will always coerce the result of map here to 0, because multi-element arrays will always ToNumber-ify to NaN. (This would be a problem if the spec allowed single-element arrays as input, but it requires 6 elements.)

@apsillers Ooh, that's a nice tip! Thanks

CJam, 18 bytes
l~[8EG]ff-:~0fe>:+

or
l~[8EG]m*::m0fe>:+

Test it here.
Explanation
The idea is decompose the point cost into three components:
 Score: 8  9 10 11 12 13 14 15 16 17 18
        0  1  2  3  4  5  6  7  8  9 10
        0  0  0  0  0  0  0  1  2  3  4
        0  0  0  0  0  0  0  0  0  1  2
       --------------------------------
 Cost:  0  1  2  3  4  5  6  8 10 13 16

All three components can be computed via a single subtraction and restricting the result to non-negative values.
l~    e# Read and evaluate input.
[8EG] e# Push [8 14 16].
ff-   e# For each pair from the two lists, subtract one from the other.
:~    e# Flatten the result.
0fe>  e# Clamp each difference to non-negative values.
:+    e# Sum them all up.

Pyth, 14 bytes
s>#0-M*Q+14yB8

Test suite
This uses the same fundamental means of calculation as Martin Büttner, namely:
max(n-8, 0) + max(n-14, 0) + max(n-16, 0)

That being said, the means of calculation are very different. To generate the list of numbers to subtract, I use the expression +14yB8. yB8 means "Bifurcate 8 on the function y". y doubles numbers, so this gives [8, 16]. Then, we add on 14, giving the list [14, 8, 16].
Next, we take the Cartesian product with the input and subtract every pair of values.
Next, perform the maximization operation, we simply filter for positive values only, and sum the remainder.

Samau, 19 bytes
Not sure if the question is posted after the last commit of my new language. They are both 2 hours ago. But all the features used here was added before that.
▐[8 14 16]`-o;0>*ΣΣ

Samau uses CP737 as its default character encoding.
▐[8 14 16]`-o;0>*ΣΣ
▐                      read a list of numbers
 [8 14 16]             push [8 14 16]
          `-           push the function [-]
            o          outer product
             ;         duplicate
              0>       for each element, test if it's larger than 0
                *      times
                 ΣΣ    take the sum twice because it's a 2d array

PowerShell, 48 Bytes
$args|%{$t+=$_-8+@{15=1;16=2;17=4;18=10}[$_]};$t

(Pretty sure this isn't optimal.)
Takes input command-line arguments and pipes them into a loop |%{...}. Each iteration, we increment our total $t+= with the current number minus 8 $_-8 plus the result of indexing into a hashtable for the more-expensive values @{...}[$_]. Then we simply output $t at the end.

() Ox++, 248 bytes (62 characters)

Language I'm working on. Paste in the code here.

My browser can only display 7 of these characters.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Levenshtein Distance
While there are many edit distance questions, such as this one, there isn't a simple question to write a program that calculates the Levenshtein distance.
Some Exposition
The Levenshtein edit distance between two strings is the minimum possible number of insertions, deletions, or substitutions to convert one word into another word. In this case, each insertion, deletion and substitution has a cost of 1.
For example, the distance between roll and rolling is 3, because deletions cost 1, and we need to delete 3 characterrs. The distance between toll and tall is 1, because substitutions cost 1.
Rules

The input will be two strings. You may assume that the strings are lowercase, only contain letters, are non-empty and are a maximum of 100 characters in length.
The output will be minimum Levenshtein edit distance of the two strings, as defined above.
Your code must a program or a function. It does not need to be a named function, but it cannot be a built-in function that directly computes the Levenshtein distance. Other built-ins are allowed.
This is code golf, so the shortest answer wins.

Some Examples
>>> lev("atoll", "bowl")
3
>>> lev("tar", "tarp")
1
>>> lev("turing", "tarpit")
4
>>> lev("antidisestablishmentarianism", "bulb")
27

As always, if the problem is unclear, please let me know. Good luck and good golfing!
Catalogue

var QUESTION_ID=67474;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=47581;var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=true,comment_page;function answersUrl(index){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(index,answers){return"http://api.stackexchange.com/2.2/answers/"+answers.join(';')+"/comments?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){answers.push.apply(answers,data.items);answers_hash=[];answer_ids=[];data.items.forEach(function(a){a.comments=[];var id=+a.share_link.match(/\d+/);answer_ids.push(id);answers_hash[id]=a});if(!data.has_more)more_answers=false;comment_page=1;getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){data.items.forEach(function(c){if(c.owner.user_id===OVERRIDE_USER)answers_hash[c.post_id].comments.push(c)});if(data.has_more)getComments();else if(more_answers)getAnswers();else process()}})}getAnswers();var SCORE_REG=/<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;var OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(a){return a.owner.display_name}function process(){var valid=[];answers.forEach(function(a){var body=a.body;a.comments.forEach(function(c){if(OVERRIDE_REG.test(c.body))body='
'+c.body.replace(OVERRIDE_REG,'')+'
'});var match=body.match(SCORE_REG);if(match)valid.push({user:getAuthorName(a),size:+match[2],language:match[1],link:a.share_link,});else console.log(body)});valid.sort(function(a,b){var aB=a.size,bB=b.size;return aB-bB});var languages={};var place=1;var lastSize=null;var lastPlace=1;valid.forEach(function(a){if(a.size!=lastSize)lastPlace=place;lastSize=a.size;++place;var answer=jQuery("#answer-template").html();answer=answer.replace("{{PLACE}}",lastPlace+".").replace("{{NAME}}",a.user).replace("{{LANGUAGE}}",a.language).replace("{{SIZE}}",a.size).replace("{{LINK}}",a.link);answer=jQuery(answer);jQuery("#answers").append(answer);var lang=a.language;lang=jQuery(''+lang+'').text();languages[lang]=languages[lang]||{lang:a.language,lang_raw:lang.toLowerCase(),user:a.user,size:a.size,link:a.link}});var langs=[];for(var lang in languages)if(languages.hasOwnProperty(lang))langs.push(languages[lang]);langs.sort(function(a,b){if(a.lang_raw>b.lang_raw)return 1;if(a.lang_raw<b.lang_raw)return-1;return 0});for(var i=0;i<langs.length;++i){var language=jQuery("#language-template").html();var lang=langs[i];language=language.replace("{{LANGUAGE}}",lang.lang).replace("{{NAME}}",lang.user).replace("{{SIZE}}",lang.size).replace("{{LINK}}",lang.link);language=jQuery(language);jQuery("#languages").append(language)}}
body{text-align:left!important}#answer-list{padding:10px;width:290px;float:left}#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Pyth, 34 bytes
J]wf}z=Jsmsm++.DdkXLdkGXLkdGhld-Jk

Demonstration
This is not particularly well golfed, and very slow. It can't handle anything past 2 changes in a reasonable period of time.

But it works, and that's what counts. :P

Matlab, 177 163 bytes
function l=c(a,b);m=nnz(a)+1;n=nnz(b)+1;for i=0:m-1;for j=0:n-1;z=max(i,j);try;z=min([l(i,j+1)+1,l(i+1,j)+1,l(i,j)+(a(i)~=b(j))]);end;l(i+1,j+1)=z;end;end;l=l(m,n)

This is a straightforward implementation of this formula:

Ungolfed:
function l=l(a,b);
m=nnz(a)+1;
n=nnz(b)+1;
for i=0:m-1;
    for j=0:n-1;
        z=max(i,j);
        try;
            z=min([l(i,j+1)+1,l(i+1,j)+1,l(i,j)+(a(i)~=b(j))]);
        end;
        l(i+1,j+1)=z;
    end;
end;
l=l(m,n)

If the scored code is not what you've included, please include the scored code. Otherwise I think there's a lot of whitespace that can be golfed out.

@AlexA. the leading space and newlines for indentation purpose are not counted (and can be removed safely). Unce upon a time this was allowed and no one complained.

@edc65 The meta consensus now is that the code as scored should be provided.

Well then, the majority prefers the unreadable version. I still let the readable version here, in case anyone might want to see what is actually going on=)

It's common practice to provide both the golfed submission (the one that's scored) as well as an ungolfed version, we just require that the scored one be included. ;)

APL (Dyalog Classic), 34 bytes
{0∊≢¨⍵:≢∊⍵⋄⌊/(≢.↑+∘∇↓¨)∘⍵¨1↓,⍳2 2}

Try it online!

This fails for 'help' f 'department'

And 'look' f 'calculate' (for a different reason, I think)

@H.PWiz fixed, thanks. different approach but luckily same byte count.

JavaScript (ES6) 106 113 122
Edit 16 bytes saved following @Neil suggestions
As an anonymous function.
(s,t)=>[...s].map((u,i)=>w=w.map((v,j)=>p=j--?Math.min(p,v,w[j]-(u==t[j]))+1:i+1),w=[...[,...t].keys()])|p

This is a golfed implementation of the Wagner–Fischer algorithm exactly as described in the linked wikipedia article, in the section Iterative with two matrix rows (even if in fact, just 1 row is used - array w)
Less golfed
(s,t)=>
{
  w = [...[0,...t].keys()];
  for(i = 0; i < s.length; i++)
    w = w.map((v,j)=>
              p = j
              ? Math.min(p+1, v+1, w[j-1] + (s[i]!=t[j-1]))
              : i+1
             );
  return p
}

Test snippet

L=(s,t)=>[...s].map((u,i)=>w=w.map((v,j)=>p=j--?Math.min(p,v,w[j]-(u==t[j]))+1:i+1),w=[...[,...t].keys()])|p

console.log=x=>O.textContent+=x+'\n';

[["atoll", "bowl"],["tar", "tarp"]
,["turing", "tarpit"],["antidisestablishmentarianism", "bulb"]]
.forEach(t=>console.log(t+' => '+L(...t)))

Can you use [...[0,...t].keys()] instead? Saves 2 bytes if you can.

@Neil that looks ugly but it's shorter. Thx

Actually you can save another byte, [...[,...t].keys()] works too I think.

I managed to shave off another byte by using [...s].map(): (s,t)=>(w=[...[,...t].keys()],[...s].map((u,i)=>w=w.map((v,j)=>p=j--?Math.min(p,v,w[j]-(s[i-1]==t[j]))+1:i)),p)

@Neil great, thanks again!

Wait, 106? I was working on another approach but I only got it down to 108: (s,t)=>[...s].map((u,i)=>(q=p=i+1,w=w.map((v,j)=>p=Math.min(++p,q-(u==t[j]),q=++v))),w=[...[...t].keys()])|p

Python 2, 151 140 138 bytes
Slow recursive implemention of the Levenshtein distance based on Wikipedia (Thanks to @Kenney for shaving of 11 chars and @Sherlock9 for another 2).
def l(s,t):
 def f(m,n):
  if m*n<1:return m or n
  return 1+min([f(m-1,n),f(m,n-1),f(m-1,n-1)-(s[m-1]==t[n-1])])
 return f(len(s),len(t))

Giving the correct answers for the presented test cases:
assert l("tar", "tarp") == 1
assert l("turing", "tarpit") == 4
assert l("antidisestablishmentarianism", "bulb") == 27
assert l("atoll", "bowl") == 3

You might save 3-4 bytes or so by doing something like if !n*m:return n if n else m, and another 2 by return 1+min([ f(..), f(..), f(..) - (s[..] == t[..]) ]).

You would save 2 bytes by using f(m-1,n-1)-(s[m-1]==t[n-1]) instead of f(m-1,n-1)+(s[m-1]!=t[n-1])-1.

Golfed off 20 chars: http://codegolf.stackexchange.com/a/102910/60919

Python 2, 118 bytes
A golf of this solution, but it doesn't look like Willem's been on for a year, so I'll have to post it myself:
def l(s,t):f=lambda m,n:m or n if m*n<1else-~min(f(m-1,n),f(m,n-1),f(m-1,n-1)-(s[m-1]==t[n-1]));print f(len(s),len(t))

Try on repl.it
Takes two strings and outputs the distance to STDOUT (allowed by meta).  Please comment suggestions, I'm sure this can be golfed further.

Is it necessary to wrap everything in a function? Could you use two input()s or an input().split()?

@Sherlock9 I tried that, but it costs 1 byte extra as far as I can tell

Right, I forgot that you need to define s and t somewhere in the code. Never mind. Good job :D

I'm not sure why Willem used m or n. You can replace it with m+n.

Haskell, 67 bytes
e@(a:r)#f@(b:s)|a==b=r#s|1<3=1+minimum[r#f,e#s,r#s]
x#y=length$x++y

Try it online! Example usage: "turing" # "tarpit" yields 4.
This is a recursive solution. Given two strings e and f, we first compare their first characters a and b. If they are equal, then the Levenshtein distance of e and f is the same as the Levenshtein distance of r and s, the remainder of e and f after removing the first characters. Otherwise, either a or b needs to be removed, or one is substituted by the other. [r#f,e#s,r#s] recursively computes the Levenshtein for those three cases, minimum picks the smallest one, and 1 is added to account for the necessary remove or replace operation.
If one of the strings is empty, we and up on the second line. In this case, the distance is just the length of the non-empty string, or equivalently the length of both strings concatenated together.

Wow, this is a seriously good solution, really elegant and short.

It seems your program outputs 0 for the input pair "abb","aab" (link). (I just found out because I wanted to steal your code for another challenge:)

@flawr Thanks for pointing out, the previous 67 byte version works correctly so I rolled back.

Python 3, 267 216 184 162 bytes
This function calculates the Levenshtein distance using an array that is 2 x len(word_2)+1 in size.
Edit: This doesn't get close to the Willem's Python 2 answer, but here is a more golfed answer with many little refinements here and there.
def e(p,q):
 m=len(q);r=range;*a,=r(m+1);b=[1]*-~m
 for i in r(len(p)):
  for j in r(m):b[j+1]=1+min(a[j+1],b[j],a[j]-(p[i]==q[j]))
  a,b=b,[i+2]*-~m
 return a[m]

Ungolfed:
def edit_distance(word_1,word_2):
    len_1 = len(word_1)
    len_2 = len(word_2)
    dist = [[x for x in range(len_2+1)], [1 for y in range(len_2+1)]]
    for i in range(len_1):
        for j in range(len_2):
            if word_1[i] == word_2[j]:
                dist[1][j+1] = dist[0][j]
            else:
                deletion = dist[0][j+1]+1
                insertion = dist[1][j]+1
                substitution = dist[0][j]+1
                dist[1][j+1] = min(deletion, insertion, substitution)
        dist[0], dist[1] = dist[1], [i+2 for m in range(len_2+1)]
    return dist[0][len_2]

Seriously, 86 82 78 bytes
,#,#`k;;;░="+l"£@"│d);)[]oq╜Riu)@d);)@[]oq╜Riu(@)@)@[]oq╜Ri3}@)=Y+km"£@IRi`;╗ƒ

Hex Dump:
2c232c23606b3b3b3bb03d222b6c229c4022b364293b295b5d6f71bd526975294064293b29405b
5d6f71bd5269752840294029405b5d6f71bd5269337d40293d592b6b6d229c40495269603bbb9f

Try It Online
(Note that the link is to a different version because something about the online interpreter breaks with the new, shorter version, even though it works fine with the downloadable interpreter.)
It's about the most straightforward implementation Seriously allows for the recursive definition. It is very slow because it does no memoization at all. Perhaps the tabular method could be shorter (maybe by using the registers as rows), but I'm fairly happy with this, despite how much kludging-my-way-around-the-language's-shortcomings it contains. That one can use
[]oq`<code>`Ri

as a proper two-argument function call was quite the nice find.
Explanation:
,#,#                             Read in two arguments, break them into lists of chars
    `                       `;╗ƒ put the quoted function in reg0 and immediately call it
     k;;;                        put the two lists in a list and make 3 copies
         ░                       replace the latter two with one with empty lists removed
          =                      replace two more with 1 if no empty lists removed, else 0
           "..."£@"..."£@        push the two functions described below, moving
                                 the boolean above them both
                         I       select the correct function based on the condition
                          Ri     call the function, returning the correct distance
                                 for these substrings

   There are two functions that can be called from the main function above. Each expects
   two strings, i and j, to be on the stack. This situation is ensured by putting
   those strings in a list and using R to call the functions with that list as the stack.
   The first is very simple:

+l                             Concatenate the strings and take their length.
                               This is equivalent to the length of the longer
                               string, since one of the strings will be empty.

   The second function is very long and complicated. It will do the "insertion, deletion,
   substitution" part of the recursive definition. Here's what happens in 4 parts:

│d);)                          After this, the stack is top[i-,j,i,j,ci,i-], where i- is
                               list i with its last character, ci, chopped off.
     []oq                      this puts i- and j into a list so that they can be passed
                               as arguments recursively into the main function
         ╜Riu                  this calls the main function (from reg0) with the args
                               which will return a number to which we add 1 to get #d,
                               the min distance if we delete a character
)@d);)@                        After this, the stack is top[i,j-,ci,i-,#d,cj,j-], where
                               j- and cj are the same idea as i- and ci
       []oq╜Riu                listify arguments, recurse and increment to get #i
                               (distance if we insert)
(@)@)@                         After this, the stack is top[i-,j-,#d,cj,#i,ci]
      []oq╜Ri                  listify arguments, recurse to get min distance between
                               them but we still need to add 1 when we'd need to
                               substitute because the chars we chopped off are different
(((@)                          After this, the stack is top[cj,ci,#s,#d,#i]
     =Y                        1 if they are not equal, 0 if they are
       +                       add it to the distance we find to get the distance
                               if we substitute here
        k                      put them all in a list
         m                     push the minimum distance over the three options

I like how the code tries to escape the pre-element :)

AutoIt, 333 bytes
Func l($0,$1,$_=StringLen,$z=StringMid)
Dim $2=$_($0),$3=$_($1),$4[$2+1][$3+1]
For $5=0 To $2
$4[$5][0]=$5
Next
For $6=0 To $3
$4[0][$6]=$6
Next
For $5=1 To $2
For $6=1 To $3
$9=$z($0,$5,1)<>$z($1,$6,1)
$7=1+$4[$5][$6-1]
$8=$9+$4[$5-1][$6-1]
$m=1+$4[$5-1][$6]
$m=$m>$7?$7:$m
$4[$5][$6]=$m>$8?$8:$m
Next
Next
Return $4[$2][$3]
EndFunc

Sample test code:
ConsoleWrite(l("atoll", "bowl") & @LF)
ConsoleWrite(l("tar", "tarp") & @LF)
ConsoleWrite(l("turing", "tarpit") & @LF)
ConsoleWrite(l("antidisestablishmentarianism", "bulb") & @LF)

yields
3
1
4
27

k4, 66 bytes
{$[~#x;#y;~#y;#x;&/.z.s'[-1 0 -1_\:x;0 -1 -1_\:y]+1 1,~(*|x)=*|y]}

A boring and basically ungolfed impl of the algo. Ex.:
  f:{$[~#x;#y;~#y;#x;&/.z.s'[-1 0 -1_\:x;0 -1 -1_\:y]+1 1,~(*|x)=*|y]}
  f["kitten";"sitting"]
3
  f["atoll";"bowl"]
3
  f["tar";"tarp"]
1
  f["turing";"tarpit"]
4
  f["antidisestablishmentarianism";"bulb"]
27

Retina, 78 72 bytes
&`(.)*$(?<!(?=((?<-4>\4)|(?<-1>.(?<-4>)?))*,(?(4),))^.*,((.)|(?<-1>.))*)

Try it online!
In a way, this is a pure regex solution where the result is the number of positions from which the regex matches. Because why not...
Fair warning, this is super inefficient. The way this works is that it offloads the actual optimisation to the regex engine's backtracker, which simply brute forces all possible alignments, starting with as few alterations as possible and allowing one more until it's possible to match up the strings with additions, deletions and substitutions.
For a slightly more sensible solution, this one does the matching only once and doesn't have any negative lookarounds. Here, the result is the number of captures in group 2, which you could access with match.Groups[2].Captures.Count in C#, for example. It's still horribly inefficient though.
Explanation
I'm explaining the second version above, because it's conceptually a bit easier (as it's just a single regex match). Here is an ungolfed version I've named the groups (or made them non-capturing) and added comments. Remember that the components in a lookbehind should be read from back to front, but alternatives and lookaheads inside those should be read from front to back. Yeah.
.+                      # Ensures backtracking from smallest to largest for next repetition
(?<ops>(?<distance>.))* # This puts the current attempted distances onto two different stacks,
                        # one to work with, and one for the result.
$                       # Make sure the lookbehind starts from the end.
(?<=                    # The basic idea is now to match up the strings character by character,
                        # allowing insertions/deletions/substitutions at the cost of one capture
                        # on <ops>. Remember to read from the bottom up.
  (?=                   # Start matching forwards again. We need to go through the other string
                        # front-to-back due to the nature of the stack (the last character we
                        # remembered from the second string must be the first character we check
                        # against in the first string).
    (?:
      (?<-str>\k<str>)  # Either match the current character against the corresponding one from
                        # the other string.
    |
      (?<-ops>          # Or consume one operation to...
        .               # consume a character without matching it to the other string (a deletion)
        (?<-str>)?      # optionally dropping a character from the other string as well
                        # (a substitution).
      )
    )*                  # Rinse and repeat.
    ,(?(str),)          # Ensure we reached the end of the first string while consuming all of the
                        # second string. This is only possible if the two strings can be matched up
                        # in no more than <distance> operations.
  )
  ^.*,                  # Match the rest of string to get back to the front.
  (?:                   # This remembers the second string from back-to-front.
    (?<str>.)           # Either capture the current character.
  |
    (?<-ops>.)          # Or skip it, consuming an operation. This is an insertion.
  )*
)

The only difference to the 72-byte version is that we can drop the leading .+ (and second group in the beginning) by finding positions at the end where we don't have enough <ops> and count all of those positions.

JavaScript (ES6),  95 91  89 bytes
Takes input as (source)(target). Essentially a port of @Willem's Python answer (later optimized by @FlipTack).
s=>t=>(g=m=>m*n?1+Math.min(g(m,--n),g(--m)-(s[m]==t[n++]),g(m)):m+n)(s.length,n=t.length)

Try it online!

Python 3, 105 94 93 99 bytes
-11 bytes by xnor
+6 bytes to fix equal case
l=lambda a,b:b>""""""<a else len(a+b)

Try it online!

Haskell, 136 bytes
Call e. Bit slow on antidisestablishmentarianism etc.
l=length
e a b=v a(l a)b(l b)
v a i b j|i*j==0=i+j|0<1=minimum[1+v a(i-1)b j,1+v a i b(j-1),fromEnum(a!!(i-1)/=b!!(j-1))+v a(i-1)b(j-1)]

Jolf, 4 bytes
Try it here!
~LiI
~L   calculate the Levenshtein distance of
  i   input string
   I  and another input string

I added that builtin yesterday, but saw this challenge today, i.e., just now. Still, this answer is noncompeting.
In a newer version:
~Li

takes implicit second input.

"Your code must a program or a function. It does not need to be a named function, but it cannot be a built-in function that directly computes the Levenshtein distance. Other built-ins are allowed."

Ah, didn't see you mentioned it's non-competing.. Better put it in the title, or add a valid program/function without builtin.

GNU Prolog, 133 bytes
m([H|A],B):-B=A;B=[H|A].
d([H|A]-[H|B],D):-d(A-B,D).
d(A-B,D):-A=B,D=0;D#=E+1,m(A,X),m(B,Y),d(X-Y,E).
l(W,D):-d(W,D),(E#<D,l(W,E);!).

Takes a tuple as argument. Example of usage:
| ?- l("turing"-"tarpit",D).

D = 4

yes

m specifies that B is A either directly or with its first character removed. d uses m as a subroutine to calculate an edit distance between the tuple elements (i.e. the distance of a series of edits that converts one into the other). Then l is a standard trick for finding the minimum of d (you take an arbitrary distance, then take an arbitrary smaller distance, repeat until you can't go smaller).

TI-Basic, 194 175 174 bytes
Prompt Str1,Str2
length(Str1→A
length(Str2→B
{A,B→dim([A]
For(I,1,A
For(J,1,B
3→dim(ʟA
{I-1,J,I,J-1,I-1,J-1→B
For(X,1,3
ʟB(2X-1→Y
ʟB(2X→Z
If YZ:Then
[A](Y,Z
Else
max(Y,Z
End
Ans→ʟA(X
End
min(ʟA+{1,1,sub(Str1,I,1)≠sub(Str2,J,1→[A](I,J
End
End
[A](A,B

-19 bytes thanks to MarcMush
-1 byte by combining the 2 Prompts on the same line.
The output is stored in Ans and is displayed at the end.

Perl, 168 166 163 bytes
sub l{my($S,$T,$m)=(@_,100);$S*$T?do{$m=++$_<$m?$_:$m for l($S-1,$T),l($S,--$T),l(--$S,$T)-($a[$S]eq$b[$T]);$m}:$S||$T}print l~~(@a=shift=~/./g),~~(@b=shift=~/./g)

Recursive implementation. Save in a file.pl and run as perl file.pl atoll bowl.
sub l {
    my($S,$T,$m)=(@_,100);

    $S*$T
    ? do {
        $m = ++$_ < $m ? $_ : $m
        for
            l($S-1,   $T),
            l($S  , --$T),
            l(--$S,   $T) - ($a[$S] eq $b[$T])
        ;
        $m
    }
    : $S||$T
}
print l~~(@a=shift=~/./g),~~(@b=shift=~/./g)

The other two implementations are both longer (full matrix: 237 bytes, twoone-row iterative: 187).

update 166: omit () in calling l.
update 163: eliminate return by abusing do in trinary.

C#, 215 210 198
public int L(string s,string t){int c,f,a,i,j;var v=new int[100];for(c=i=0;i<s.Length;i++)for(f=c=i,j=0;j<t.Length;j++){a=c;c=f;f=i==0?j+1:v[j];if(f<a)a=f;v[j]=c=s[i]==t[j]?c:1+(c<a?c:a);}return c;}

more readable:
public int L(string s,string t){
    int c,f,a,i,j;
    var v=new int[100];
    for(c=i=0;i<s.Length;i++)
        for(f=c=i,j=0;j<t.Length;j++){
            a=c;
            c=f;
            f=(i==0)?j+1:v[j];
            if (f<a) a=f;
            v[j]=c=(s[i]==t[j])?c:1+((cy?x:y)
#define r(x,y) l(s,ls-x,t,lt-y)
int l(char*s,int ls,char*t,int lt){if(!ls)return lt;if(!lt)return ls;a=r(1,1);if(s[ls]==t[ls])return a;return m(m(r(0,1),r(1,0)),a)+1;}
---------

Detailed
#include <stdio.h>

#define m(x,y) (x>y?x:y)
#define f(x) char x[128];fgets(x,100,stdin)
#define r(x,y) l(s,ls-x,t,lt-y)

int l(char*s,int ls,char*t,int lt)
{
    if(!ls) return lt;
    if(!lt) return ls;

    int a = r(1,1);
    if(s[ls]==t[ls]) return a;

    return m(m(r(0,1),r(1,0)),a)+1;
}

int main(void)
{
    f(a);
    f(b);
    printf("%d", l(a,strlen(a),b,strlen(b)));
    return 0;
}

PowerShell v3+, 247 Bytes
$c,$d=$args;$e,$f=$c,$d|% le*;$m=[object[,]]::new($f+1,$e+1);0..$e|%{$m[0,$_]=$_};0..$f|%{$m[$_,0]=$_};1..$e|%{$i=$_;1..$f|%{$m[$_,$i]=(($m[($_-1),$i]+1),($m[$_,($i-1)]+1),($m[($_-1),($i-1)]+((1,0)[($c[($i-1)]-eq$d[($_-1)])]))|sort)[0]}};$m[$f,$e]

I ended up making this to solve another challenges involving LD's.
Code explanation with comments.
# Get both of the string passed as arguments. $c being the compare string
# and $d being the difference string.
$c,$d=$args

# Save the lengths of these strings. $e is the length of $c and $f is the length of $d
$e,$f=$c,$d|% le*

# Create the multidimentional array $m for recording LD calculations
$m=[object[,]]::new($f+1,$e+1)

# Populate the first column
0..$e|%{$m[0,$_]=$_}

# Populate the first row
0..$f|%{$m[$_,0]=$_}

# Calculate the Levenshtein distance by working through each position in the matrix.
# Working the columns
1..$e|%{
    # Save the column index for use in the next pipeline
    $i=$_

    # Working the rows.
    1..$f|%{
        # Calculate the smallest value between the following values in the matrix relative to this one
        # cell above, cell to the left, cell in the upper left.
        # Upper left also contain the cost calculation for this pass.
        $m[$_,$i]=(($m[($_-1),$i]+1),($m[$_,($i-1)]+1),($m[($_-1),($i-1)]+((1,0)[($c[($i-1)]-eq$d[($_-1)])]))|sort)[0]
    }
}
# Return the last element of the matrix to get LD
$m[$f,$e]


text:
Compute the Binary Sierpinski Triangle Sequence
The Binary Sierpinski Triangle sequence is the sequence of numbers whose binary representations give the rows of the Binary Sierpinski Triangle, which is given by starting with a 1 in an infinite row of zeroes, then repeatedly replacing every pair of bits with the xor of those bits, like so:
f(0)=      1                    =1
f(1)=     1 1                   =3
f(2)=    1 0 1                  =5
f(3)=   1 1 1 1                 =15
f(4)=  1 0 0 0 1                =17

More digits are given at OEIS: https://oeis.org/A001317
Input: A non-negative integer n in any format you like. (Must work for all n up to 30.)
Output: The nth term (0-indexed) of the sequence as a decimal number.
This is code-golf so try give the shortest answer in bytes of which your language is capable. No answer will be accepted.
Standard loopholes apply (e.g. no hard-coding the sequence), except that you may use a language created/modified after this challenge was posted. (Do avoid posting another solution in a language that has already been used unless your solution is shorter.)
Leaderboard
The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
## Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
## Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
## Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the snippet:
## [><>](http://esolangs.org/wiki/Fish), 121 bytes

/* Configuration */

var QUESTION_ID = 67497; // Obtain this from the url
// It will be like http://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 47050; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "http://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "http://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

I'm not a big fan of must not output a wrong answer for any n. This basically forces languages that do not use arbitrary precision integers by default to check if the input is small enough...

Please clarify if understood the rules correctly (see comments here and here) and if rounded output (e.g., 1.288490189e10 for input 33) counts as wrong.

"Must work for all n up to 30, and must not output a wrong answer for any n.".  This is self-contradictory - surely "must not output a wrong answer" is the same as "Must work" ???

Due to overwhelming popular opposition to the unreasonable and soul-crushing burden of input validation, this requirement has been removed. You may output whatever garbage you want for large n. Enjoy!

Rather than saying that the output shouldn't be wrong, I would recommend just saying that submissions have to support input up to the largest n for which nothing overflows.

05AB1E, 5 4 bytes
I proudly present to you, 05AB1E. Although it is very short, it is probably very bad at long challenges.
Thanks to ETHproductions for shaving off 1 byte :)
$Fx^

Explanation:
$      # Pushes 1 and input
 F     # Pops x, creates a for-loop in range(0, x)
  x    # Pops x, pushes x and 2x
   ^   # Bitwise XOR on the last two elements
       # Implicit, ends the for-loop
       # Implicit, nothing has printed so the last element is printed automatically

You know, a good way to golf a byte off of many programs in a custom language is to make a trailing } be automatically inserted. Then this would be 4 bytes. :)

@ETHproductions Wait a minute, that already has been implemented :). Thanks for shaving off 1 byte haha.

There's a bug in this code. How do I know? It's beating Dennis.

@Ampora Not only is it beating Dennis, it's beating Dennis's custom golfing language. ;)

@Adnan Wow. You're on to something.

@RK. It's only good at small easy tasks though.

only good at small easy tasks pfffft

Pari/GP, 27 bytes
n->lift(Mod(x+1,2)^n)%(x-2)

The function takes the \$n\$-th power of the polynomial \$x+1\$ in the ring \$\mathbb{F}_2[X]\$, lifts it to \$\mathbb{Z}[X]\$, and then evaluates it at \$x=2\$.
Try it online!

Jelly, 6 bytes
1Ḥ^$³¡

Try it online!
The binary version that works with this revision of the Jelly interpreter has the xxd dump
0000000: 31 a8 5e 24 8b 80  1.^$..

How it works
1Ḥ^$³¡    Input: n

1         Set the left argument to 1.
 Ḥ        Multiple the left argument by two.
  ^       Hook; XOR it with its initial value.
   $      Create a monadic chain from the last two insructions.
    ³¡    Call the chain n times, updating the left argument after each call.

Haskell, 44 bytes
import Data.Bits
f n=iterate((2*)>>=xor)1!!n

In the ((->) r) monad, (f >>= g) x equals g (f x) x.

I think you can anonymize the last line to (iterate((2*)>>=xor)1!!)

I tried that, but it doesn't work, for dreaded monomorphism restriction reasons.

However, that might apply as a legal expression, since the monomorphism restriction doesn't apply on expressions, but declarations. And expressions are considered legal answers, if I'm not mistaken.

JavaScript (ES6), 23 bytes
f=x=>x?(y=f(x-1))^y*2:1

Based on the first formula on the OEIS page. If you don't mind the code taking almost forever to finish for an input of 30, we can shave off a byte:
f=x=>x?f(--x)^f(x)*2:1

Here's a non-recursive version, using a for loop in an eval: (32 bytes)
x=>eval("for(a=1;x--;a^=a*2);a")

The rules, as currently written, invalidate this answer, since f(35) returns 15. Also, fork bomb alert: I had to force-close Chromium to stop f(30) (original revision) from running. :P

@Dennis Wait, so if I can't output any wrong value, what am I supposed to do with inputs higher than 30?

I'm not sure (and I hope the rule gets changed), but something like f=x=>x?(y=f(x-(x<31)))^y*2:1 would work.

@Dennis Ah, recurse infinitely = no output. I'll fix this when I get back to my computer. I hope that rule gets changed as well.

The rule has been removed from the question.

Matlab, 45 bytes
Solution:
@(i)2.^[0:i]*diag(mod(fliplr(pascal(i+1)),2))

Test:
ans(10)
ans =
1285

Explanation:
pascal constructs Pascal triangle, but it starts from 1, so input should be i+1. fliplr flips array from left to right. mod(_,2) takes remainder after division by 2. diag extracts main diagonal.Multiplication using 2.^[0:i] converts vector to decimal
I'm glad, @flawr that I found Matlab competitor here :)

Seems to work with Octave as well.

Matlab, 77 70 bytes
This function calculates the n-th row of the Pascal triangle via repeated convolution with [1,1] (a.k.a. binomial expansion or repeated multiplication with a binomial), and calculates the number from that.
function r=c(n);k=1;for i=1:n;k=conv(k,[1,1]);end;r=2.^(0:n)*mod(k,2)'

CJam, 10 bytes
1ri{_2*^}*

Test it here.
Simple iterative solution using bitwise XOR.

Ruby, 26 bytes
anonymous function with iteration.
->n{a=1;n.times{a^=a*2};a}

this recursive function is one byte shorter, but as it needs to be named to be able to refer to itself, it ends up one byte longer.
f=->n{n<1?1:(s=f[n-1])^s*2}

Ruby, 25 bytes
->n{eval"n^=2*"*n+?1*n=1}

Shorter than the other answers on here so far. It constructs this string:
n^=2*n^=2*n^=2*n^=2*1

Then it sets n=1 (this actually happens while the string is being made) and evaluates the above string, returning the result.

Does that *n=1 actually save anything over m=1;"m^=2*"*n+?1

No, but doing it with just one variable is very showy :)

Samau, 4 bytes
Now Samau has built-in functions for XOR multiplication and XOR power.
▌3$ⁿ

Hex dump (Samau uses CP737 encoding):
dd 33 24 fc

Explanation:
▌       read a number
 3      push 3
  $     swap
   ⁿ    take the XOR power

Could this be reduced to 3 bytes by swapping the first two commands and eliminating the swap?

@quintopia No. Samau automatically pushes the input onto the stack as a string , and ▌ reads a number from the string. If we swap the first two commands, it would try to read a number from 3, which is not a string.

why doesn't samau try to eval the string when possible?

MIPS, 28 bytes
Input in $a0, output in $v0.
0x00400004  0x24020001          li      $v0, 1
0x00400008  0x10800005  loop:   beqz    $a0, exit
0x0040000c  0x00024021          move    $t0, $v0
0x00400010  0x00021040          sll     $v0, $v0, 1
0x00400014  0x00481026          xor     $v0, $v0, $t0
0x00400018  0x2084ffff          addi    $a0, $a0, -1
0x0040001c  0x08100002          j       loop

Pure Bash (no external utilities), 37
Bash integers are 64-bit signed, so this works for inputs up to and including 62:
for((x=1;i++<$1;x^=x*2)){
:
}
echo $x

Python 2.7.6, 38 33 bytes
Thanks to Dennis for shaving off a few bytes!
x=1
exec'x^=x*2;'*input()
print x

Welcome to Programming Puzzles & Code Golf! exec'x^=x*2;'*input() saves a few bytes over the for approach.

This beats my Python entry, which I'll just leave here for posterity: f=lambda n:f(n-1)^2*f(n-1)if n>0 else 1

Pyth, 7 bytes
uxyGGQ1

Try it online: Demonstration
Explanation:
u    Q1   apply the following statement input-times to G=1:
 xyGG        update G with (2*G xor G)

MATL, 15 bytes
Similar to @flawr's answer:
i:1w"TToX+]2\XB

EDIT (May 20, 2016) Try it online! with X+ replaced by Y+ to conform to version 18.0.0 of the language.
Example
>> matl i:1w"TToX+]2\XB
> 5
51

Explanation
i              % input
:              % vector of values 1, 2, ... to previous input
1              % number literal
w              % swap elements in stack
"              % for
    TTo        % vector [1 1]
    X+         % convolution
]              % end
2\             % modulo 2
XB             % convert from binary to decimal

Perl 5, 23 bytes
$.^=2*$.for 1..<>;say$.

Try it online!

Mathematica, 40 24 bytes
Nest[BitXor[#,2#]&,1,#]&

k4, 26 bytes
{x{2/:~(=). 0b\:'1 2*x}/1}

0b\: converts a number to a boolean vector (i.e. bitstring), XOR is implemented as "not equal", 2/: converts a bitstring back to a number by treating it as a polynomial to evaluate, and x f/y with x an integer is f applied to y first, and then to its successive outputs x times.
Sample run:
  {x{2/:~(=). 0b\:'1 2*x}/1}'!5
1 3 5 15 17

Ruby, 31 26 bytes
EDIT: Changed to a different language entirely! All golfing suggestions welcome!
This program bitwise XORs the previous element of the sequence with twice itself, i.e. f(n) = f(n-1) ^ 2*f(n-1).
->n{v=1;n.times{v^=2*v};v}

brainfuck, 87 bytes
,[>>[>]++<[[->+>+<<]>-->[-<<+>>]<[>+<-[>-<-]]>+<<<]>>>[[-<+>]>]<<[<]<-]>>[<[->++<]>>]<+

Try it online!
Assumes infinite sized cells (otherwise it can’t get past 7, which is conveniently 255). The Pascal’s triangle mod 2 method is actually much longer because of the costly mod 2 operation, while XOR is much easier to implement.

Stax, 5 bytes
±s┤ε─

Run and debug online!
Port of the Jelly answer.
Uses ASCII representation to explain:
ODcH|^
O         Put 1 under top of stack
 D        Repeat for times specified by input
  cH|^    Xor the number with itself doubled
          Implicit output

Seriously, 12 bytes
2,╣`2@%`Mεj¿

Hex Dump:
322cb960324025604dee6aa8

Try it online
Since Seriously does not include any means of doing a bitwise xor, this solution takes the challenge completely literally, directly computing the given row of the triangle. This method gives correct answers up to n=1029 (after which there is not enough memory to compute the given row of Pascal's triangle).
Explanation:
 ,                       get input
  ╣                 push the nth row of pascal's triangle
   `2@%`M           take each element of the row mod 2
         εj         join all the binary digits into a string
2          ¿        interpret it as a base 2 number

APL, 31 bytes
{({2⊥⊃~1 2=.{(64⍴2)⊤⍺×⍵}⍵}⍣⍵)1}

This is almost certainly awful code, but I'm a complete APL newb. I expect anyone with any skill could get rid of all the D-functions and shorten it considerably. The logic is more or less the same as my k4 answer -- multiply by 1 or 2, convert to bits with ⊤, XOR using not equals, convert back to a number with ⊥, wrap the whole thing in a function and ask for a specific number of iterations using ⍣. I have no idea why the result coming out of the inner product is enclosed, but ⊃ cleans that up.

You should be able to save a byte by changing ~1 2=. to 1 2≠.

And, which APL system is this on? If it's on Dyalog, you should be able to make it {({2⊥⊃1 2≠.((64⍴2)⊤×)⍵}⍣⍵)1} [28 bytes]

Pyt, 40 10 bytes
Đ0⇹Řć2%ǰ2Ĩ

Explanation:
Observing that the Binary Sierpinski Triangle is equivalent to Pascal's Triangle mod 2,
                      Implicit input
Đ                     Duplicate input
 0⇹Ř                  Push [0,1,2,...,input]
    ć2%               Calculate the input-th row of Pascal's Triangle mod 2
       ǰ              Join elements of the array into a string
        2Ĩ            Interpret as a binary number
                      Implicit print

Try it online!