text:
Draw a ladder and slide
Your task is to create a program or function that takes, as input, a natural number (n) between 1 and 25 (inclusive) and prints an isometric representation of a slide and ladder with n number of rungs.
Ladder and slide specifications
The ladder is always oriented on the left and the slide on the right. We're viewing it from the ladder side, so part of the slide is obscured at the top three levels. The rungs are represented by four dashes (----) and the sides of the ladder and slide by slashes (/ and \). The following is a diagram to represent the patterns of spaces needed for a slide with five rungs.
Slide              Blank space count
    /----/\        1234/----/\
   /----/  \       123/----/12\
  /----/    \      12/----/1234\
 /----/ \    \     1/----/1\1234\
/----/   \    \    /----/123\1234\

Examples
>>1
/----/\

>>3
  /----/\
 /----/  \
/----/    \

>>4
   /----/\
  /----/  \
 /----/    \
/----/ \    \

>>10
         /----/\
        /----/  \
       /----/    \
      /----/ \    \
     /----/   \    \
    /----/     \    \
   /----/       \    \
  /----/         \    \
 /----/           \    \
/----/             \    \

This is code-golf, so the answer with the lowest byte count wins.
Note: trailing white space is acceptable in the output, as long as it doesn't exceed the length of the line.

You would break your legs at the end of that slide!

@Fatalize that'd be... Fatal.

@Fatalize bonus points for you if you draw a pool at the bottom ;)

@atlasologist A pool of blood?

Apologies if this is a dumb question, but a couple of the answers below (Python, JavaScript) define a function that returns a string rather than printing it. Is that kosher?

@Jordan "Your task is to create a program or function..." It's likely that he meant that, as that's fairly common practice when also allowing functions.

@VTCAKAVSMoACE "...and prints an isometric representation of a slide and ladder..."

@Jordan I'd prefer printing, as this is ASCII art and it should be displayed. However, I wouldn't necessarily think an answer that returns from a function should be disqualified since I was possibly a little vague in the question, but I might reserve my vote on it.

Retina, 81 72 52 bytes
Byte count assumes ISO 8859-1 encoding.
.+
$* /\    \
^.

+` /(.+)$
$&¶$%`/  $1
/.{5}
/----/

Try it online!
Explanation
The program consists of four stages, all of which are regex substitutions (with a couple of Retina-specific features). I'll use input 5 as an example for the explanation.
Stage 1
.+
$* /\    \

This turns the input n into n spaces followed by /\    \ which will become the top of the ladder/slide:
     /\    \

For now, we'll just show the slide in full and represent the ladder only by its left-hand /.
Stage 2
^.

Unfortunately, n spaces are one more than we need, so we remove the first character again. We've now got:
    /\    \

Stage 3
+` /(.+)$
$&¶$%`/  $1

Time to expand the complete structure. Knowing where the top is, is sufficient to build the entire thing, because we can simply extend it one line at a time, moving the ladder and the slide apart by two spaces.
The + tells Retina to repeat this stage in a loop until the output stops changing (in this case, because the regex stops matching). As for the regex itself, we simply match the / on the last line and everything after it and we also match one space in front of it, which means this can no longer match once / has reached the first column.
Here's what we replace this with:
 $&    The match itself. We don't want to remove the line we already have.
 ¶     A linefeed, because we want to append a new line.
 $%`   This is a very recent addition to Retina: it's like the normal $` but
      is bounded by linefeeds. That means this inserts everything in front
      of the match which is on the same line. In particular this one space
      less than the indentation of the matched line, hence we are shifting
      the / one column left.
 /     A literal /, representing the left edge of the ladder.
>  <   Two spaces, so that we can shift the slide one column right.
 $1    Capturing group 1 which contains the slide and its separation from
      the ladder.

So at each iteration, this adds one line to the string, until we end up with this:
    /\    \
   /  \    \
  /    \    \
 /      \    \
/        \    \

Stage 4
/.{5}
/----/

All that's left is getting the ladder right. That's really simple, we just match the / and the next 5 characters and insert the correct ladder representation, thereby overriding the slide or spaces that are already there:
    /----/\
   /----/  \
  /----/    \
 /----/ \    \
/----/   \    \

V, 38, 37, 36, 34, 33, 32, 31, 30 29 bytes
Àé r\2é/4é-òhYpX$2P^ò3GEòjlr\

Try it online!
I might catch up with Osabie. One byte shorter than Osabie. \o/ Tied with 2sable! One byte shorter!
In other news, this is definitely the longest strikethrough header I've ever made.
Explanation:
Àé              "Insert 'arg1' spaces
   r\           "Turn the last one into a '\'
     2é/        "Insert 2 '/'
        4é-     "Insert 4 '-'

ò        ò      "Recursivly:
 h              "  Move one to the left
  Yp            "  Duplicate this line
    X           "  Delete one space from the left
     $2P        "  Paste two spaces at the end of this line
        ^       "  Move back to the beginning of this line.

This will run until an error occurs, which thanks to the "move left" command ('h'), will be 'arg1' times.
Now we just need to add the inner leg
3GE             "Move to the second slash of line 3
   ò    ò       "Recursively: (The second 'ò' is implicit)
    jl          "  Move down and to the right
      r\        "  And replace the character under the cursor with a '\'

Non-competing version (28 bytes)

2sable, 40 36 32 30 bytes
Hmmm, V is coming awfully close...
F¹N-<ð×…/--Â«ðð«N×…\  Â««5F¦}¶

Uses the CP-1252 encoding. Try a 05AB1E compatible version!.

And the battle rages on: http://codegolf.stackexchange.com/a/85985/31716 :P

@DrGreenEggsandIronMan Hmmm!!?!?!

There's one more off, and one more once I get home. Also, I'm not switching languages. :P

Pyth, 39 35 bytes
VQ++*dt-QN"/----/">+*+ddN"\    \\"5

Explanation:
VQ                                  # Interate over 0 -> Q-1 (Q is the input)
  +                                 # Concatenate the 2 halfs of the slide
   +                                # Concatenate the whitespace block and the ladder
    *d                              # Multiply d (whitespace) by this number \/
      t-QN                          # Calculate the amount of spaces before : input - step of the iterarion -1
          "/----/"                  # Ladder
                  >               5 # Remove the first 5 chars  from the string generated in the following lines
                   +                # Concatenate the whitespace block and the slide
                    *+ddN           # Multiply "+dd" (2 whitespace) by the step of the iterarion to generate the space between the ladder and the slide
                         "\    \\"  # Slide

Test here

PowerShell v2+, 99 90 82 bytes
param($n)1..$n|%{" "*($n-$_)+"/----/"+-join(" "*($_+$i++)+"\    \")[6..(6+$_+$i)]}

Takes input $n, starts a loop from 1 to $n with |%{...}. Each iteration, we're constructing a string. We start with the appropriate number of spaces " "*($n-$_) and the ladder "/----/".
To that, we add another string that's been sliced [...] and -joined back together. The second string is the slide, and we assume that the whole slide is always visible. It's the number of spaces before the slide would start " "*($_+$i++), followed by the slide itself "\    \". This is sliced by a range calculated out to be the part of the "spaces plus slide" that's partially hidden by the ladder.
Examples
PS C:\Tools\Scripts\golfing> .\draw-a-ladder-and-slide.ps1 7
      /----/\
     /----/  \
    /----/    \
   /----/ \    \
  /----/   \    \
 /----/     \    \
/----/       \    \

PS C:\Tools\Scripts\golfing> .\draw-a-ladder-and-slide.ps1 15
              /----/\
             /----/  \
            /----/    \
           /----/ \    \
          /----/   \    \
         /----/     \    \
        /----/       \    \
       /----/         \    \
      /----/           \    \
     /----/             \    \
    /----/               \    \
   /----/                 \    \
  /----/                   \    \
 /----/                     \    \
/----/                       \    \

+1 because the slashes in your directory line up with the slashes in the test output. :D

Your \golfing folder must be very organized ._.

Vim, 71 keystrokes
This is such a stupid way of doing it, but it's a bit of fun. Input is given as a text file with a single line containing an integer. This is likely quite golfable, but it'll do for now (edit: switched style of control characters upon request):
A@qyyPgg<c-v><c-v>GkI <c-v><esc>G$i  <c-v><esc><esc>
Tq"qDI/----/\^[lD@"ddh<c-v>god:%s/     \\/\\    \\<cr>

<c-v>, <esc> and <cr> are all individual keystrokes; ctrl+v, escape, and carriage return (enter) respectively. For a simple to digest version with the correct literals, here is the file ladder.keys run though xxd:
00000000: 4140 7179 7950 6767 1616 476b 4920 161b  A@qyyPgg..GkI ..
00000010: 4724 6920 2016 1b1b 5471 2271 4449 2f2d  G$i  ...Tq"qDI/-
00000020: 2d2d 2d2f 5c1b 6c44 4022 6464 6816 676f  ---/\.lD@"ddh.go
00000030: 643a 2573 2f20 2020 2020 5c5c 2f5c 5c20  d:%s/     \\/\\
00000040: 2020 205c 5c0d 0d0a                         \\...

To try it out (assuming a nix with the appropriate tools) take the above, run it through xxd -r and put in the file ladder.keys. Create a file ladder.txt with an integer in it. Then do:
vim -s ladder.keys -u NONE ladder.txt

We usually write ^V as <c-v> here.

@Jordan They are one keystroke each, counting modified keys (shift, ctrl or alt with another key) as one keystroke. The keystrokes are Ctrl+v, escape and enter.

@algmyr My mistake. I misread your answer earlier.

Python 2 - 79 76 75 bytes
x=input()
for i in range(x):print(x-i)*' '+'/----/'+(i*'  '+'\\    \\')[5:]

Thanks to Hubert Grzeskowiak for "disqualifying" me since making my program print actually saved 3 bytes!
Thanks also to Eʀɪᴋ ᴛʜᴇ Gᴏʟғᴇʀ for saving 1 more byte!

Nice! By the way, lambda was okay, I think, since strictly speaking it is a sort of function. Using lambda you can save a newline and a space :-)

Wait, I actually tried it with lambda and couldn't get it working. It's bc of the print, I guess?

@HubertGrzeskowiak Well it depends on challenge specifications. If the question asked for a program/function that returns a string representation of a slide, either of my answers would be valid. Since it specifies "print" as you pointed out, I would have either needed to name the lambda function and print a call to it, or do what I did above which was shorter.

The specs don't tell that the function has to be named, or be called ;-)

Convert it to a full program: replace def f(x): with x=input(), and remove the indentation on the second line. This saves you 1 byte.

bash, 61
for((;i<$1;)){ printf "%$[$1+i]s\    \^M%$[$1-++i]s/----/\n";}

where ^M is a literal carriage return
$ ./ladder 1
/----/\
$ ./ladder 4
   /----/\
  /----/  \
 /----/    \
/----/ \    \
$ ./ladder 10
         /----/\
        /----/  \
       /----/    \
      /----/ \    \
     /----/   \    \
    /----/     \    \
   /----/       \    \
  /----/         \    \
 /----/           \    \
/----/             \    \

I think you should have a single space between / and \\ in the 4th row, and 1 less space between slide edges.

It should be 4 dashes, not 5.

@algmyr thank you that saves 2 bytes

JavaScript (ES6), 79 bytes

f=
n=>" ".repeat(n).replace(/./g,"$'/$`$`\\    \\\n").replace(/\/...../g,"/----/")
;
<input type=number min=0 oninput=o.textContent=f(this.value)><pre id=o>

Works by taking a string of n spaces, then doing some exotic substitution to get the slide with a support, then replacing the support with a ladder.

Ruby, 61 bytes
->n{n.times{|i|puts"%*s\\    \\\r%*s----/"% [n+i,"",n-i,?/]}}

Ungolfed
->(num_rows) {
  num_rows.times {|row_idx|
    puts "%*s\\    \\\r%*s----/" % [ num_rows + row_idx, "", num_rows - row_idx, "/" ]
  }
}

I could save two bytes by using '%*s\    \^M%*s----/' (where ^M is a literal carriage return) for the format string, but then Ruby prints the warning "warning: encountered \r in middle of line, treated as a mere space". ¯\_(ツ)_/¯
Previous solution (64 bytes)
->n{n.times{|i|puts" "*(n+i)+"\\    \\\r"+" "*(n-i-1)+"/----/"}}

Batch, 194 bytes
@echo off
for /l %%i in (1,1,%1)do call:l %1 %%i
exit/b
:l
set s=\    \
for /l %%j in (1,1,%2)do call set s=  %%s%%
set s=/----/%s:~7%
for /l %%j in (%2,1,%1)do call set s= %%s%%
echo%s%

Turned out to be reasonably straightforward: indent the slide, remove the first 7 characters, indent the ladder, remove the leading space. This last bit does involve a little trickery though!

Haskell, 81 bytes
a n=[1..n]>>" "
f n=[1..n]>>=(\i->a(n-i)++"/----/"++drop 7(a(2*i)++"\\    \\\n"))

do i<-[1..n];a(n-i)++"/----/"++drop 7(a(2*i)++"\\    \\\n") saves two bytes.

Java, 116 bytes
c->{for(int i=0;i<c;i++)System.out.format("%"+(5+c-i)+"s%"+(i<3?i*2+1:2*(i-2))+"s%5s\n","/----/","\\",i<3?"":"\\");};

Unfortunately, you can't [easily] duplicate strings in Java, so I end up abusing the format function.

Scala, 95 bytes
def l(n:Int)=for(i<- 0 to n-1){println(" "*(n-i-1)+"/----/"+("  "*i+"\\    \\").substring(5))}

eacal, noncompeting, 386 bytes
init .
define @ curry push .
define ~ curry exec .--func
alias $ strap
alias ' string
set n set m cast number arg number 0
set s empty string
label l
@ get n
set n ~ dec
@ space
@ get n
$ ~ repeat
$ ' /----/
@ space
@ get m
@ get n
@ ~ sub
@ ~ dec
@ number 2
@ ~ mul
$ ~ repeat
$ ' \
$ newline
@ get n
@ number 0
if ~ more
goto l
@ $
@ regex gm '   ( {4})(?=.$)
@ '  \$1
print ~ replace

I have officially made the most verbose language possible. I made the comment in jest and in sarcasm. Please calm down. Instructions on how to run in the github repo linked in the header.
Ungolfed
init .
set n set m cast number arg number 0
set s empty string
label loop
    push . get n
    set n exec .--func dec
    push . space
    push . get n
    strap exec .--func repeat
    strap string /----/
    push . space
    push . get m
    push . get n
    push . exec .--func sub
    push . exec .--func dec
    push . number 2
    push . exec .--func mul
    strap exec .--func repeat
    strap string \
    strap newline
    push . get n
    push . number 0
    if exec .--func more
        goto loop

push . strap
push . regex gm string   ( {4})(?=.$)
push . string  \$1
print exec .--func replace

"I have officially made the most verbose language possible." Excuse me, have you heard of AppleScript?

@VTCAKAVSMoACE Alright, let's make a deal. You answer this question in applescript. Then I'll tell you this is more verbose.

It's not verbose enough if you can ungolf it.

@VTC, TimmyD, and Neil: Geez. You happy now?

@CᴏɴᴏʀO'Bʀɪᴇɴ We're obviously joking around, lol

@VTCAKAVSMoACE Hilarious.


text:
Sort a list of unknown values with the least amount of comparisons
In this optimization challenge you will write a program that sorts a single array by only comparing elements through asking the user on stdout to input comparison results on stdin.
The below protocol is line-based, so everytime you print to stdout or read from stdin it is assumed a newline follows. Throughout the question below it is assumed that the user (read: the scoring program) has an array it wants sorted in a 0-based indexed array called array. For technical reasons I suggest flushing after every print to stout.

As your first step your program must read the array size n from stdin.
Then, as often as you wish, you can print a < b to stdout, with two integers 0 <= a, b < n. Then the user will enter 1 in stdin if array[a] < array[b], and 0 otherwise.
Finally, once your program is convinced it has correctly deduced the order of the array, it must print a ... to stdout, where ... is a space separated list of integers indicating the order. So if your program outputs a 3 0 1 4 2 it means your program has deduced
array[3] <= array[0] <= array[1] <= array[4] <= array[2]

Note that your program never knew the contents of array, and never will.

You can only ask for < on stdin to sort the array. You can get other comparison operations by these equivalencies:
a > b        b < a
a <= b       !(b < a)
a >= b       !(a < b)
a != b       (a < b) || (b < a)
a == b       !(a < b) && !(b < a)

Finally, since your program interacts with the scoring program on stdout, print debug information to stderr.

Your program will be scored using the following Python program:
from __future__ import print_function
from subprocess import Popen, PIPE
import sys, random

def sort_test(size):
    array = [random.randrange(0, size) for _ in range(size)]
    pipe = Popen(sys.argv[1:], stdin=PIPE, stdout=PIPE, bufsize=0, universal_newlines=True)
    print(str(size), file=pipe.stdin); pipe.stdin.flush()
    num_comparisons = 0
    while True:
        args = pipe.stdout.readline().strip().split()
        if args and args[0] == "a":
            answer_array = [array[int(n)] for n in args[1:]]
            if list(sorted(array)) != answer_array:
                raise RuntimeError("incorrect sort for size {}, array was {}".format(size, array))
            return num_comparisons
        elif len(args) == 3 and args[1] == "<":
            a, b = int(args[0]), int(args[2])
            print(int(array[a] < array[b]), file=pipe.stdin); pipe.stdin.flush()
            num_comparisons += 1
        else:
            raise RuntimeError("unknown command")

random.seed(0)
total = 0
for i in range(101):
    num_comparisons = sort_test(i)
    print(i, num_comparisons)
    total += num_comparisons
print("total", total)

You score your program by typing python score.py yourprogram. The scoring is done by having your program sort one random array of each size 0 to 100 and counting the amount of comparisons your program asks for. These random arrays can have duplicates, your algorithm must be able to handle equal elements. In the event there are duplicates, there are no requirements on the order of the equal elements. So if the array is [0, 0] it doesn't matter if you output a 0 1 or a 1 0.
You may not optimize specifically for the particular arrays the scoring program generates. I may change the RNG seed at any point in time. Answers using built-in sorting algorithms are permitted to be posted for interest's sake, but are non-competing.
Program with lowest score wins.

Which version of Python are you using?

How long did it take to run your scoring algorithm?

What assumptions can we make on the maximum size of the input array?

@helloworld922 Theoretically, none - your answer should work for any size. But if it saves effort in a language like C supporting everything up to and include 100 elements is required.

It’s important to clarify the Python version used by the scoring program, because Python 2 and 3 generate different random sequences. Or perhaps it would be better if the randomness came from a well-specified deterministic source such as hashlib.

Python, score 23069
This uses the Ford–Johnson merge insertion sorting algorithm.
from __future__ import print_function
import sys

def less(x, y):
    print(x, '<', y)
    sys.stdout.flush()
    return bool(int(input()))

def insert(x, a, key=lambda z: z):
    if not a:
        return [x]
    m = len(a)//2
    if less(key(x), key(a[m])):
        return insert(x, a[:m], key) + a[m:]
    else:
        return a[:m + 1] + insert(x, a[m + 1:], key)

def sort(a, key=lambda z: z):
    if len(a) <= 1:
        return a
    m = len(a)//2
    key1 = lambda z: key(z[-1])
    b = sort([insert(x, [y], key) for x, y in zip(a[:m], a[m:2*m])], key=key1)
    if len(a) % 2:
        b += [[a[-1], None]]
    for k in range(m, len(a)):
        l, i, (x, y) = max((-i.bit_length(), i, t) for i, t in enumerate(b) if len(t) == 2)
        b[:i + 1] = insert([x], b[:i], key=key1) + [[y]]
    if len(a) % 2:
        b.pop()
    return [x for x, in b]

print('a', ' '.join(map(str, sort(range(int(input()))))))

Python, 333300 score
from __future__ import print_function
import sys

size = int(input())

def less(a, b):
    print(a, "<", b); sys.stdout.flush()
    return bool(int(input()))

array = list(range(size))
for _ in range(size):
    for i in range(0, size-1):
        if less(array[i+1], array[i]):
            array[i], array[i+1] = array[i+1], array[i]

print("a", " ".join(str(i) for i in array)); sys.stdout.flush()

This is an example program, implementing the simplest form of bubblesort, always doing n*(n-1) comparisons per array.
I scored this program by saving it as sort.py and typing python score.py python sort.py.

If being exact, it's Python 3. I see by print looking like a function.

@zyabin101 Now it's both :)

Python 3, 28462 score
Quick sort. Pivot is leftmost item.
The score is expected, because:

from __future__ import print_function
import sys
size = int(input())

def less(a, b):
    print(a, "<", b); sys.stdout.flush()
    return bool(int(input()))

def quicksort(array):
    if len(array) < 2:
        return array
    pivot = array[0]
    left = []
    right = []
    for i in range(1,len(array)):
        if less(array[i],pivot):
            left.append(array[i])
        else:
            right.append(array[i])
    return quicksort(left)+[pivot]+quicksort(right)

array = list(range(size))
array = quicksort(array)

print("a", " ".join(str(i) for i in array)); sys.stdout.flush()

Scores for each size tested:
size score
0 0
1 0
2 1
3 3
4 6
5 8
6 11
7 12
8 15
9 17
10 23
11 33
12 29
13 32
14 37
15 45
16 58
17 47
18 52
19 79
20 72
21 60
22 85
23 138
24 87
25 98
26 112
27 107
28 128
29 142
30 137
31 136
32 158
33 143
34 145
35 155
36 169
37 209
38 163
39 171
40 177
41 188
42 167
43 260
44 208
45 210
46 230
47 276
48 278
49 223
50 267
51 247
52 263
53 293
54 300
55 259
56 319
57 308
58 333
59 341
60 306
61 295
62 319
63 346
64 375
65 344
66 346
67 370
68 421
69 507
70 363
71 484
72 491
73 417
74 509
75 495
76 439
77 506
78 484
79 458
80 575
81 505
82 476
83 500
84 535
85 501
86 575
87 547
88 522
89 536
90 543
91 551
92 528
93 647
94 530
95 655
96 580
97 709
98 671
99 594
100 637
total 28462

@orlp here, the last line translates to "WindowsError: [Error 193] %1 is not a correct Win32 application."

Python 2 (non-competing), 23471 score
from __future__ import print_function
import sys
size = int(input())

def cmp(a, b):
    print(a, "<", b); sys.stdout.flush()
    return [1,-1][bool(int(input()))]

array = list(range(size))
array = sorted(array,cmp=cmp)

print("a", " ".join(str(i) for i in array)); sys.stdout.flush()

Scores for each size tested:
size score
0 0
1 0
2 1
3 4
4 5
5 7
6 9
7 14
8 17
9 20
10 21
11 26
12 30
13 35
14 37
15 41
16 45
17 51
18 52
19 57
20 63
21 63
22 72
23 79
24 79
25 80
26 91
27 93
28 96
29 105
30 110
31 116
32 124
33 123
34 131
35 130
36 142
37 144
38 156
39 154
40 163
41 168
42 177
43 178
44 183
45 183
46 192
47 194
48 212
49 207
50 216
51 221
52 227
53 239
54 238
55 243
56 255
57 257
58 260
59 270
60 281
61 284
62 292
63 293
64 303
65 308
66 312
67 321
68 328
69 328
70 342
71 348
72 352
73 358
74 367
75 371
76 381
77 375
78 387
79 400
80 398
81 413
82 415
83 427
84 420
85 435
86 438
87 448
88 454
89 462
90 462
91 479
92 482
93 495
94 494
95 502
96 506
97 520
98 521
99 524
100 539
total 23471

I think Python already implements a very good sorting function, looking at the optimal number of comparisons here: https://en.wikipedia.org/wiki/Comparison_sort#Number_of_comparisons_required_to_sort_a_list
Looks like this will be a reference for a very very good baseline.

source: Stack Exchange

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

sort: votes