text:
Tuning Strings
Task
Write a program to determine the note sounded, along with how many cents out of tune, of a string tuned to a given frequency and pressed down at a given point.
For the sake of simplicity, assume that the frequency of the sound produced and the length of the string to the right of where it is pressed are inversely proportional.
Note: this task deals solely in the fundamental tone, and not with overtones/other harmonics.
Input
Your program is given two pieces of data:

A string of arbitrary length, representing the string in question. This string will be marked with an X where the string is to be held down.
[-----] is a string divided in six sections (five divisions).
[--X--] is a string pressed at the exact center of the string.
[X----] is a string pressed at 1/6 the length of the string. (Length used is 5/6)
[-X--] is a string pressed at 2/5 of the length of the string. (Length used is 3/5)

Assume the note is sounded using the part of the string to the right of the X.
A number (not necessarily an integer), signifying the frequency at which the string is tuned. The precision of this number will be at most four digits past the decimal.

It may be assumed that frequencies passed will lie between 10 Hz and 40000 Hz.
Input may be passed in a format of your choice. Please specify how input is accepted into your program in your answer.
Output
Your program must output both the closest note* in the twelve-tone equal temperament tuning system, and the number of cents away from the closest note that the sound denoted by the string would be (rounded to the nearest cent).
+n cents should be used to denote n cents sharp/above the note, and -n cents for flat/below the note.
The note should be outputted in scientific pitch notation. Assume A4 is tuned to 440Hz. Use b and # for flat/sharp notes. Note: Either sharp or flat may be used. For the note at 466.16Hz, either A# or Bb may be outputted for the note.
Format of output is up to you, as long as the output contains only the two previously specified pieces of information (i.e. printing every single possible output is not allowed).
*closest note refers to the note that is closest to the sound denoted by the input, measured in the number of cents (therefore, the note that is within 50 cents of the sound). If the sound is 50 cents away from two different notes (after rounding), then either of the two notes may be outputted.
Examples
Your program should work for all cases, not just the following examples.
Output             Input Frequency   Input String
A4,  +0  cents     220               [-----X-----]
A5,  +0  cents     220               [--------X--]
D5,  -2  cents     440               [--X--------]
B4,  -49 cents     440               [X----------]
A#4, +19 cents*    314.1592          [X-]
Eb9, +8  cents*    400               [-----------------------X]
Eb11,+8  cents*    100               [--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------X]
D#1, +49 cents*    10                [--X]
A0,  -11 cents     11.7103           [---X--]

*Either sharp or flat could have been outputted.
Potentially Helpful Links

Notes and Frequencies
Wikipedia page on Scientific Pitch Notation
Wikipedia page on Cents

This is code-golf so shortest answer wins.

I think your examples are somewhat inconsistent: According to the first one [--X--] the string is pressed in the middle of the division where the x is placed, while the last one [-X--] would be at 3/8 (not 2/5) when following this logic. Or do I understand something wrong?

@flawr for the last one, [-X--], the string is divided at 4 places (and therefore into 5 parts), and pressed at the second of these divisions. Thus, it is pressed at 2/5, and the length used is 3/5.

Ah ok now I see, so each - basically represents the position of the divisions, thank you for explaining!

BBC Basic, 161#
  REM get frequency and string. Store length of string in n for later.
  INPUT f,s$
  n=LEN(s$)

  REM store floating-point value of note in semitones above (C0-0.5). Store integer value in n% (offset effectively means it will be rounded not truncated.)
  n=LN(f*(n-1)/(n-INSTR(s$,"X"))/15.8861)/LN(2)*12
  n%=n

  REM format printing to whole numbers only
  @%=2^17

  REM Output note name and octave. Output cents (discrepancy between n and n%, minus the offset of 0.5)
  PRINT MID$("C C#D D#E F F#G G#A A#B ",n%MOD12*2+1,2);INT(n/12)'(n-0.5-n%)*100'

Score excludes comments. Not golfed yet.
Output
Performs correctly on all test cases except the two long ones. For Eb9 it seems there is one dash missing from the test case: There are 22 - and one X, which divides the string into 24 equal pieces. According to my manual calculations, this is 9600Hz, which is 37 cents above a D9. This is exactly what my program outputs. If I add another dash I get Eb9 + 8 cents. Unfortunately BBC Basic cannot handle strings over 255 characters, so the Eb11 case gives an error.

C, 179
main(n,d){float f;scanf("%*[^X]%nX%*[-]%n]%f",&n,&d,&f);f=log(f*d/(d-n))*17.3123-57.376;n=d=f+.5;n=n%12*7+784;printf("%c%d%c,%+2.0f cents\n",n/12,(d+9)/12,n%12/7*3+32,(f-d)*100);}

Receives the ascii picture on a line by itself, and the frequency on a separate line.
A few characters can be dropped by reducing the accuracy of the magic numbers 17.3123 and 57.376.
Without the golfing, the program looks like this:
main(n,d)
{
    float f; // 'float' and '%f' better than 'double' and '%lf'

    scanf("%*[^X]%nX%*[-]%n]%f", &n, &d, &f);
    // n is the number of chars before 'X'
    // d is the number of chars before ']'
    // f is the frequency

    // Calculate the tuned frequency
    f = f * d / (d - n);

    // Convert the frequency to logarithmic scale, relative to pitch A0
    f=log(f)*17.3123-57.376;
    // alternatively: f = log2(f / (440 / 16)) * 12;

    // Round to nearest integer
    n=d=f+.5;

    // Calculate the note name ('A', 'B', etc), multipled by 12 for convenience
    n=n%12*7+784;

    printf("%c%d%c,%+2.0f cents\n", // output example: B4 ,-49 cents
        n/12,        // note name
        (d+9)/12,    // octave number
        n%12/7*3+32, // if n%12 is large enough, it's '#' else ' ' (natural)
        (f-d)*100);  // number of cents; stdio rounds it to integer
}

+1 for the awesome scanf format string. I had no idea you could do that. I will check you output code later (I thought about doing this in C and although something similar occurred to me for the output, I couldn't see a way to do the whole thing competitively.) I assume d+9 is because you're indexed on note A so you have to adjust the octave number to the index on note C: I wonder if there is a way around that.

Yes, the +9 compensates for the fact that octaves start at C. It's either that or making a similar fix to the calculation of note name. For note names, the circular shift could be implemented by a LUT, but I like the more "mathematical" way of calculating them.

JavaScript (199)
Call it e.g. as t('[X-]',314.1592)
t=(s,f)=>{l=s.length-1;p='C C# D D# E F F# G G# A B H'.split(' ');n=12*Math.log2(f*l/(l-s.indexOf('X'))/16.3515978);m=n+.5|0;return p[m%12]+(n/12|0)+' '+((n-m)*100+.5|0)}

Fixed. (Since I live in europe I used B instead of Bb and H instead of B=)

Flawr, are you German? I always thought of B and H as a German notation, not a European notation. UK and Ireland use Bb and B. Spain and Italy use SIb and SI (as in DO RE MI FA SOL LA SI.). Anyway it's only a saving of one character.

Yes I am form a german speaking country, I was not aware that other european countries use that Doremi system (I only heard people use it in children education). Anyway it was primarly a joke since as you said it only saves 1 char and does not really meet the requirements=)

This seems to round the number of cents incorrectly if the number of cents is negative (for example, t('[---X--]',11.7103) (last example) gives -10 instead of -11

Using p="C0C#0D0D#0E0F0F#0G0G#0A0B0H".split(0) saves you an additional 2 characters.

@es1024 Oh I should have known: It is because I implemented the round function by round(x) = x+.5|0 which is only correct for positive numbers, I'll fix that later. @ipi thanks!

Python 3: 175
import math
def t(b,s):l=len(s)-1;n=12*math.log2(b*l/(l-s.index("X"))/16.35);m=round(n);return"%s%s%+d"%(("C C# D D# E F F# G G# A A# B".split()*99)[m],m//12,round(100*(n-m)))

Ungolfed:
import math

c0 = 16.35

def tuning (base_frequency, string):
    return formatted (note_number (frequency (base_frequency, string)))

def formatted (note_number):
    return "{name}{octave:d}{cents:+d}".format (name=note_name (note_number),
                             octave=octave (note_number),
                             cents=cents_out (note_number))

def note_name (note_number):
    return ("C C# D D# E F F# G G# A A# B".split() * 99)[round (note_number)]

def note_number (frequency):
    return 12 * math.log2 (frequency / c0)

def octave (note_number):
    return round (note_number) // 12

def cents_out (note_number):
    return round (100 * (note_number - round (note_number)))

def frequency (base_frequency, string):
    string_length = len (string) - 1
    held_length = string_length - string.index ("X")
    return base_frequency * string_length / held_length

if "__main__" == __name__:

    print ("Testing functions against known values...")
    assert "A4+0"     == tuning (220,      "[-----X-----]")
    assert "A5+0"     == tuning (220,      "[--------X--]")
    assert "D5-2"     == tuning (440,      "[--X--------]")
    assert "B4-49"    == tuning (440,      "[X----------]")
    assert "A#4+19"   == tuning (314.1592, "[X-]")
    assert "D#9+8"    == tuning (400,      "[-----------------------X]")
    assert "D#11+8"   == tuning (100,      "[--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------X]")
    assert "D#1+49"   == tuning (10,       "[--X]")
    assert "A0-11"    == tuning (11.7103,  "[---X--]")
    print ("Tests passed.")


text:
Print ASCII Voxels
Write a program that reads a \$n\times n \times n\$ array of binary values which represent an \$n\times n \times n\$ cube, that consists of \$n^3\$ smaller cubes. Each value says whether there is a voxel (small cube) present in the given position or not. The program must output the given array as an ASCII graphic (that means output through console or writing to a file).
Examples
Let us consider the following \$2\times 2\times 2\$ arrays:
[
 [[0,0],
  [1,0]]
 [[1,1],
  [1,0]],
]

[
 [[0,0],
  [0,0]]
 [[1,1],
  [1,1]],
]

In this case the output should look like this (it does not look as good here as it does in code editors/consoles with less vertical space):
  +----+
 /    /|-+----+
+----+ |     /|
|    | +----+ |
|    | |    | +
+    + |    |/
|    | +----+
|    |/
+----+

    +----+----+
   /         /|
  +         + |
 /         /  +
+----+----+  /
|         | +
|         |/
+----+----+

An example for a \$12\times 12\times 12\$ input string can be found here (pastebin). A new example for a \$7\times 7\times 7\$ input string can be found here.
Specifications of the ASCII
Each corner of a voxel is represented by a + as long as there is any edge leading to it. The + are also drawn when there is a straight edge that is more than one unit long. There are three types of edges: The horizontal left to right ----, the horizontal back to front / and the vertical
|
|

Each of those has to end in a + (as long visible). The edges will not be drawn when they subdivide one planar plane into two or more pieces (unlike the + in relation to the edges as stated above). Structures that are hidden behind others must not be drawn.
The 'drawing' is basically a parallel projection so only top, right and front sides are visible - always from the same angle.
Details
The code must be working for inputs of size \$n=1,2,\ldots,12\$. Trailing spaces and unnecessary newlines before/after are allowed (so you could write a code that always basically outputs the \$12\times 12\times 12\$ grid even when the actual size of the drawing is only \$3\times 3\times 3\$ or so).
Input formatting and method is up to you, you can use csv, JSON or any other stuff, but it has to consist of \$1\$ and \$0\$ for the state of each voxel. The order must be as in the examples:

1st dimension: layer by layer from the uppermost to the lowermost
2nd dimension: row by row back (furthest away) to front (nearest)
3rd dimension: voxels in each row left to right

Whether you use console or reading files as input and output is up to you. Please tell us about your code / how you approached it.
Judging
This is codegolf so the fewest number of bytes wins. This includes ONLY the part that actually does the work - when counting bytes you can consider the input already as parsed and saved in a variable and you have to have the output string saved to a variable, ready to be printed. The parsing and the output itself does not count.
(And I will upvote submissions with creative examples=)
This was inspired by Rob's Puzzle page.

Python ( 444 361 354 bytes)
Edit: I found another bug that would omit a corner cross in very special cases. A straight forward fix added 50 bytes to the code so I tried to golf it down a bit further. Now the bug is fixed and it's even 83 bytes shorter. It's becoming very hacky. I also wanted to get rid of the fivefold for loop but could not yet find a solution. Any ideas?
Edit 2: With a very long import I can save another 7 characters.
Neither very short nor very elegant, but then again it is a complex problem:
#input:
u=[[[1,1,1],[1,0,1],[1,1,1]],
   [[1,0,1],[0,0,0],[1,0,1]],
   [[1,1,1],[1,0,1],[1,1,1]]]

#actual code that counts:
r=range
n=len(u)
g=r(n)
a=([' ']*9*n+['\n'])*6*n
t='/|-+\n '
d=dict(zip(t+'%!=*',2*t))
for y,z,x,i,j in __import__('itertools').product(g,g,g[::-1],r(6),r(8)):
 if abs(i+j-6)<5*u[x][y][z]:a[(9*n+1)*(i+3*x+2*y)+j+5*z-2*y+2*n]+='./    %|+====* ||    ! *|    !/.*----+'[8*i+j-8]
o=''.join((d[x[-1]],' ')[x[-2:]in('%/','!|','=-')or x[-4:]=='*++*']for x in a)

#output:
print o

It first draws all the individual voxels with all lines on top of each other. Then it outputs only the topmost characters and gets rid of those lines and crosses on planar planes that should not be drawn according to the specs.
I guess it's possible to golf this down quite some more, but 444 is such a nice number. :)
Example 3x3x3 and 7x7x7 output (with some newlines removed):
        +----+----+----+
       /              /|
      +    +----+    + |
     /    /|   /    /  +
    +    +----+    +   |
   /              /  + |
  +----+----+----+  /| +
  |              | + | |
  |              | |-+ |
  +    +----+    + |/  +
  |    | +--|    | +  /
  |    |/   |    |   +
  +    +----+    +  /
  |              | +
  |              |/
  +----+----+----+

                +----+----+----+    +----+----+----+
               /              /|   /              /|
              +    +----+    + |  +    +----+    + |
             /    /|   /    /  + /    /|   /    /  +
            +    + |  +    +  / +    + |  +    +  /
           /    /  +-/    /  + /    /  +-/    /  +
          +----+  /-+----+  /-+----+  /-+----+  /--+
          |    | +  |    | +  |    | +  |    | +  /|
        +----+ | |+----+ | |+----+ | |+----+ | | + |
       /    /| + /    /| + /    /| + /    /| + |/  +
      +    + | |+    + | |+    + | |+    + | | +   |
     /    /  + /    /  + /    /  + /    /  + |   + |
    +    +----+    +   |+    +----+    +   | +  /| +
   /              /  + /              /  + | | + | |
  +----+----+----+  /|+----+----+----+  /| + |/--+ |
  |              | + ||              | + | |-+  /  +
  |              |/--+|              |/--+ |   +  /
  +----+----+----+  / +----+----+----+  /  +  /  +
    +    +  / +    +--- +    +  /-+    +  /--+  /--+
   /    /  + /              /  + /    /  +   | +  /|
  +----+  / +----+----+----+  /-+----+  /--+ |/  + |
  |    | +  |              | +  |    | +  /|-+  /  +
  |    | |-+|              |/  +|    | | + |   +  /
  +    + |  +----+----+----+  /|+    + |/  +  /  +
  |    | +----+----+ | |+    + ||    | +  /--+  /
  |    |/         /| + /    /  +|    |   +   | +
  +    +----+----+ | |+----+  /-+    +  /--+ |/
  |              | + ||    | +  |    | +  /|-+
  |              | | +|    | | +|    |/  + |
  +----+----+    + | |+    + |/|+----+  /  +
    +    +--|    | + ||    | + |  +    +  /
   /        |    | |-+|    |   +-/    /  +
  +----+----+    + |  +    +  / +----+  /
  |              | +  |    | +  |    | +
  |              |/   |    |/   |    |/
  +----+----+----+    +----+    +----+

Nice job! Very compact compared to my mess. Check your concave edges though! (missing plus signs) - http://repl.it/XA9/2

@PiGuy: Good catch! I think I fixed it. It made my code a bit longer but I also found some things golf further, so I'm magically still at the same byte count.

It seems there is one '+' too much on the closer '4'. (Can you also try the 7x7x7 one I posted?)

@flawr: That plus sign belongs to the far 4 (far lower right corner) so it should be right. :) I'll add the 7x7x7 case. I first left it out because I thought it would clutter this page if everybody posts it, but I guess that's fine.

Ah now I see - I think I was tricked by the big vertical spaces.

Lua (1442 bytes)
Bonus animations! :)
If you have any cool voxel art in the same format as the examples,  link it in the comments and I'll make an animation out of it
7x7x7

12x12x12

This is my first code golf, so its quite messy and I plan on improving it or porting it to a different language.
Here is what i have, right now at just under 2.5kB barely-golfed (just removed indentation whitespace at this point, I will continue more later)
Here is the now ~1.4kB golfed and minified version (note the "a" table on the first line is the placeholder for the voxel matrix):
local a={}
local b,c=table,string;local d,e,f,g,h,i=b.concat,#a,c.gsub,c.gmatch,ipairs,b.insert;local function j(k,l,m)return a[k]and a[k][l]and a[k][l][m]==1 end;local n={}for o=1,e*5+1 do n[o]={}for p=1,e*7+1 do n[o][p]=" "end end;local q=[[
__6hhhh7
_g    ij
1aaaa2 j
b    d 5
b    de_
3cccc4__
]]local function r(k,l,m)local s=q;if j(k,l,m)then local t,u,v,w,x,y,z,A=j(k-1,l,m),j(k+1,l,m),j(k,l,m-1),j(k,l,m+1),j(k,l-1,m),j(k+1,l+1,m),j(k+1,l,m+1)," "if t then s=f(s,"[ai]"," ")end;if u and not y then A=A.."c"end;if u and not z then A=A.."e"end;if v then A=A.."bg"end;if w then A=A.."di"end;if x then if not j(k,l-1,m+1)then A=A.."j"end;A=A.."h"end;if t then if w and j(k-1,l,m+1)then A=A.."2"end;if v and j(k-1,l,m-1)then A=A.."1"end end;if u then if w and j(k+1,l,m+1)then A=A.."4"end;if v and j(k+1,l,m-1)then A=A.."3"end end;if x then if w and j(k,l-1,m+1)then A=A.."7"end;if v and j(k,l-1,m-1)then A=A.."6"end;if u and j(k+1,l-1,m)then A=A.."5"end end;s=f(f(f(f(f(s,"["..A.."]"," "),"[ach]","-"),"[bdj]","|"),"[gie]","/"),"[1234567]","+")else s=nil end;return s end;local B,C;local D=e*2-1;local E=1;for k=e,1,-1 do for l=1,e do for m=1,e do B=(l-1)*-2+(m-1)*5+D;C=(l-1)*2+(k-1)*3+E;local s=r(k,l,m)if s then local F={}for G in s:gmatch("[^\n]+")do local H={}for I in G:gmatch(".")do i(H,I)end;i(F,H)end;for J,K in h(F)do for L,I in h(K)do if I~="_"then n[C+J-1][B+L-1]=I end end end end end end end;for o,a in h(n)do print(d(a))end

Edit: Here is the original (over 3kB) ungolfed version, including my edits for making the animation (if you are running it yourself and want the animation, change the false near the bottom of the code to true.
local v = {}
local depth = #v;

function voxel(y,z,x)
  return (v[y] and v[y][z] and v[y][z][x]==1)
end

local canvas = {}
print("Constructing canvas of depth",depth)
for i=1,depth*5+1 do
  canvas[i] = {}
  for j=1,depth*7+1 do
    canvas[i][j] = " "
  end
end

local voxelProto = [[
__6hhhh7
_g    ij
1aaaa2 j
b    d 5
b    de_
3cccc4__
]]

function renderVoxel(y,z,x)
  local vox = voxelProto
  if (voxel(y,z,x)) then
    local up = voxel(y-1,z,x)
    local down = voxel(y+1,z,x)
    local left = voxel(y,z,x-1)
    local right = voxel(y,z,x+1)
    local back = voxel(y,z-1,x)
    local downFront = voxel(y+1,z+1,x)
    local downRight = voxel(y+1,z,x+1)

    if (up) then
      vox = vox:gsub("[ai]"," ")
    end
    if (down and not downFront) then
      vox = vox:gsub("[c]"," ")
    end
    if (down and not downRight) then
      vox = vox:gsub("[e]"," ")
    end
    if (left) then
      vox = vox:gsub("[bg]"," ")
    end
    if (right) then
      vox = vox:gsub("[di]"," ")
    end
    if (back and not voxel(y,z-1,x+1)) then
      vox = vox:gsub("[j]"," ")
    end
    if (back or up) then
      vox = vox:gsub("[h]"," ")
    end
    if (up and right and voxel(y-1,z,x+1)) then
      vox = vox:gsub("[2]"," ")
    end
    if (up and left and voxel(y-1,z,x-1)) then
      vox = vox:gsub("[1]"," ")
    end
    if (down and right and voxel(y+1,z,x+1)) then
      vox = vox:gsub("[4]"," ")
    end
    if (down and left and voxel(y+1,z,x-1)) then
      vox = vox:gsub("[3]"," ")
    end
    if (back and right and voxel(y,z-1,x+1)) then
      vox = vox:gsub("[7]"," ")
    end
    if (back and left and voxel(y,z-1,x-1)) then
      vox = vox:gsub("[6]"," ")
    end
    if (back and down and voxel(y+1,z-1,x)) then
      vox = vox:gsub("[5]"," ")
    end

    vox = vox:gsub("[ach]","-")
    vox = vox:gsub("[bdj]","|")
    vox = vox:gsub("[gie]","/")
    vox = vox:gsub("[1234567]","+")
  else
    vox = nil
  end
  return vox
end
local xpos,ypos
local minx = depth*2-1
local miny = 1;

local pic = {}
function drawCanvas()
  for k,v in pairs(canvas) do
    pic[k] = table.concat(v)
  end
  return table.concat(pic,"\n")
end

local timeline = {}
print("Compositing voxels")
for y=depth,1,-1 do
  for z=1,depth do
    for x = 1,depth do
      xpos = (z-1)*-2 + (x-1)*5 + minx
      ypos = (z-1)*2 + (y-1)*3 + miny
      local vox = renderVoxel(y,z,x)
      if (vox) then
        local vt = {}
        for line in vox:gmatch("[^\n]+") do
          local vtl = {}
          for c in line:gmatch(".") do
            table.insert(vtl,c)
          end
         table.insert(vt,vtl)
        end
        for ly,chars in ipairs(vt) do
          for lx,c in ipairs(chars) do
            if (c ~= "_") then
              canvas[ypos+ly-1][xpos+lx-1] = c
            end
          end
        end
        table.insert(timeline,drawCanvas())
      end
    end
  end
end

if (false) then -- change to true if you want to see the animation!
  for i=1,#timeline do
    local t = os.clock() + 0.05
    io.write(timeline[i],'\n\n')
    io.flush()
    while (t > os.clock()) do end
  end
end
print(timeline[#timeline])

Here is a sample of code that will populate the voxel matrix from a string for a 3x3x3 voxel matrix. (It will take any string in a similar format, but make sure it is a cube or things will probably break.)
To use this, insert this chunk right after the first line local v = {}
local vs = [[
100
000
000

110
100
000

111
110
101
]]
for layer in vs:gmatch("[^a]+") do
 local a = {}
 for row in layer:gmatch("[^\n]+") do
 local b = {}
 for _vox in row:gmatch("[01]") do
 table.insert(b,(_vox=="1") and 1 or 0)
 end
 table.insert(a,b)
 end
 table.insert(v,a)
end

Here is the output from the given 12x12x12 voxel pattern: (and yes it does look better on a normal console/text viewing apparatus, there is a bit too much vertical spacing here)
                                                                          +----+----+
                                                                         /         /|
                                                                        +----+----+ |
                                                                        |         | +
                                                            +----+      |         |/
                                                           /    /|      +    +----+
                                                          +----+ |      |    | +----+
                                                          |    | +      |    |/    /|
                                                          |    | |      +    +----+ |
                                                          +    + |      |         | +
              +----+----+                         +----+--|    | +      |         |/
             /         /|                        /        |    | |      +    +----+
            +----+----+ |                       +----+----+    + |      |    | +----+
            |         | +                       |              | +      |    |/    /|
            |         |/       +----+----+----+ |              | |      +    +----+ |
            +    +----+       /              /| +    +----+    + |      |         | +
            |    | +         +----+----+----+ | |    | +--|    | +      |         |/
            |    | |         |              | + |    |/   |    | |      +----+----+
            +    + |         |              | | +    +----+    + |
            |    | +         +    +----+    + | |              | +
            |    | |         |    | +--|    | + |              |/
            +    + |         |    |/   |    | | +----+----+----+
            |    | +----+    +    +----+    + |
            |    |/    /|    |              | +
            +    +----+ |    |              |/
            |         | +    +----+----+----+
            |         |/
            +----+----+                                       +----+----+
                                                             /         /|
                                                  +----+    +----+----+ |
                                                 /    /|    |         | +
                                                +----+ |    |         |/
                                                |    | +    +    +----+
      +----+----+----+  +----+----+----+----+---|    | |---+|    | +----+-+----+----+
     /              /| /                        +    + |    |    |/    /|          /|
    +----+----+----+ |+                         |    | +    +    +----+ |         + |
    |              | +                          |    | |    |         | +        /  +
    |              | |      +----+----+----+    +    + |    |         |/        +  /
    +    +----+    + |     /              /|    |    | +    +    +----+        /  +
    |    | +--|    | +    +----+----+----+ |    |    | |    |    | +          +  /
    |    |/   |    | |    |              | +    +    + |    |    | |         /  +
    +    +----+    + |    |              | |    |    | +    +    + |        +  /
    |              | +    +    +----+    + |    |    | |    |    | +       /  +
    |              | |    |    | +--|    | +    +    + |    |    |/       +  /
    +----+----+    + |    |    |/   |    | |    |    | +    +----+       /  +
      +----+--|    | +    +    +----+    + |    |    |/                 +  /
     /        |    | |    |              | +    +----+                 /  +
    +----+----+    + |    |              |/                           +  /
    |              | +    +----+----+----+                           /  +
    |              |/                                               +  /
    +----+----+----+                                               /  +
      +                                                           +  /
     /                                                           /  +
    +                                                           +  /
   /                                                           /  +
  +                                                           +  /
 /                                                           /  +
+----+----+----+----+----+----+----+----+----+----+----+----+  /
|                                                           | +
|                                                           |/
+----+----+----+----+----+----+----+----+----+----+----+----+

Here is the output from the 7x7x7 example here
              +----+----+----+    +----+----+----+
             /              /|   /              /|
            +    +----+    + |  +    +----+    + |
           /    /|   /    /  + /    /|   /    /  +
          +    + |  +    +  / +    + |  +    +  /
         /    /  +-/    /  + /    /  +-/    /  +
        +----+  /-+----+  /-+----+  /-+----+  /--+
        |    | +  |    | +  |    | +  |    | +  /|
      +----+ | |+----+ | |+----+ | |+----+ | | + |
     /    /| + /    /| + /    /| + /    /| + |/  +
    +    + | |+    + | |+    + | |+    + | | +   |
   /    /  + /    /  + /    /  + /    /  + |   + |
  +    +----+    +   |+    +----+    +   | +  /| +
 /              /  + /              /  + | | + | |
+----+----+----+  /|+----+----+----+  /| + |/--+ |
|              | + ||              | + | |-+  /  +
|              |/--+|              |/--+ |   +  /
+----+----+----+  / +----+----+----+  /  +  /  +
  +    +  / +    +----+    +  /-+    +  /--+  /--+
 /    /  + /              /  + /    /  +   | +  /|
+----+  / +----+----+----+  /-+----+  /--+ |/  + |
|    | +  |              | +  |    | +  /|-+  /  +
|    | |-+|              |/  +|    | | + |   +  /
+    + |  +----+----+----+  /|+    + |/  +  /  +
|    | +----+----+ | |+    + ||    | +  /--+  /
|    |/         /| + /    /  +|    |   +   | +
+    +----+----+ | |+----+  /-+    +  /--+ |/
|              | + ||    | +  |    | +  /|-+
|              | | +|    | | +|    |/  + |
+----+----+    + | |+    + |/|+----+  /  +
  +    +--|    | + ||    | + |  +    +  /
 /        |    | |-+|    |   +-/    /  +
+----+----+    + |  +    +  / +----+  /
|              | +  |    | +  |    | +
|              |/   |    |/   |    |/
+----+----+----+    +----+    +----+

Wow, looks great=) Could you also include the parsing/output code even though it does not count - just so that non-luaners can reproduce your results=)

I included a new example, would be great if you could include that too=)

Updated with the new 7x7x7 sample, also added the snippet for generating the table from the pastebin strings.

@7x7x7: It seems your program does not draw concave vertical edges. Like on top of that curve on the back (further) side of the top layer. or similarly on the front (near) right side on the lowest layer. I totally love the animations!

@flawr Thanks, I fixed it as well as spent some time getting the byte count down and am now below 1.5kB, and I added the full code i used for creating the animations as well.

source: Stack Exchange

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

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

sort: votes


text:
Generate Loopy puzzles
Loopy is a puzzle game from the collection of Simon Tatham. The previous link contains a javascript implementation of a Loopy puzzle generator. I suggest everybody who wants to attempt this challenge to solve a couple of puzzles manually to understand how they are supposed to work.
Here are instructions on how to solve a Loopy puzzle:

Chapter 23: Loopy
You are given a grid of dots, marked with yellow lines to indicate
  which dots you are allowed to connect directly together. Your aim is
  to use some subset of those yellow lines to draw a single unbroken
  loop from dot to dot within the grid.
Some of the spaces between the lines contain numbers. These numbers
  indicate how many of the lines around that space form part of the
  loop. The loop you draw must correctly satisfy all of these clues to
  be considered a correct solution.
In the default mode, the dots are arranged in a grid of squares;
  however, you can also play on triangular or hexagonal grids, or even
  more exotic ones.
Credit for the basic puzzle idea goes to Nikoli [10].
Loopy was originally contributed to this collection by Mike Pinna, and
  subsequently enhanced to handle various types of non-square grid by
  Lambros Lambrou.
[10] http://www.nikoli.co.jp/puzzles/3/index-e.htm (beware of Flash)

The goal of this task is to write your own Loopy puzzle generator. Since graphics are way too complicated, you have to output a generated puzzle in ASCII like the example puzzle of size 7×7 below. The advantage of the output format described here is that you can output your puzzle into a line printer and solve it with a pen.
+ + + + + + + +
         2 3
+ + + + + + + +
 2       2   3
+ + + + + + + +
 2   2 1 3
+ + + + + + + +
 2         1 2
+ + + + + + + +
   2 1 2 3 3
+ + + + + + + +
     3 2   1
+ + + + + + + +
         2 2
+ + + + + + + +

Input specification
Your program shall receive as input:

An integer parameter in the range 2 to 99, x (width)
An integer parameter in the range 2 to 99, y (height)
An integer parameter in the range 0 to 9, d (difficulty)

If you choose to implement the deterministic option, your program shall further receive as input:

A positive integer parameter, s (seed)

In submissions written in languages that have the notion of program or command line arguments, the input shall be provided as a set of program arguments. The invocation will be like this:
program <x> <y> <d> <s>

where <s> is left out if you do not choose to implement the deterministic option.
In submissions written in languages that have the concept of an invocation URL (i.e. the URL the program is called at), input shall be provided as a set of URL parameters like this:
http://site.example/program?x=<x>&y=<y>&d=<d>&s=<s>

where the &s=<s> part is left out if you do not choose to implement the deterministic option.
In languages that fit into neither category, input is to be received in an implementation defined way. Hard coding input is not an acceptable implementation defined way, except if your language provides no mean to receive input.
Your program shall terminate and generate output as specified below for each combination of parameters with meaningful values. The behavior of your program is unspecified if any parameter is missing, invalid, or outside of the specified range.
Output specification
Your program shall output a square-grid Loopy puzzle formatted as described above with an implementation-defined line terminator. Your implementation may fill each line with an arbitrary amount of trailing whitespace characters.
The grid shall have x×y cells where x and y are the width and height parameters specified further above. The puzzle your program generates shall have exactly one solution.
The difficulty of the problems your program generates shall depend on the d parameter, where a d value of 0 shall generate easy problems and a d value of 9 shall generate hard problems. Please document how the difficulty of the problems you generate changes depending on the d parameter.
If you choose to implement the deterministic option, the output of your program shall only depend on the value of the input. Different values for s shall yield different puzzles with a high probability for the same combination of x, y, and d. If you do not choose to implement the deterministic option, the output of your program shall be different every time the program is executed with a high probability. You can assume that the program is not executed more than one time per second.
Scoring
The score of your program is the number of characters in its source except for omittable whitespace characters and omittable comments. You are encouraged to indent your submission so it's easier to read for the others and to comment your solution so its easier to follow.
Your submission may violate some of the rules described above. Please document specific rule violations and add the corresponding penalty to your score. Rule violations not documented here make your submission invalid.

Your program contains instances of undefined behavior or violations of your language's rules (128)
Your program ignores the d parameter but generates hard puzzles (256)
Your program does not terminate or crashes in rare cases (512)
Your program ignores the d parameter but generates easy puzzles (1024)
Your program generates puzzles with more than one solution (2048)
Your program generates unsolvable puzzles in rare cases (4096)

Judgement
The winner of this contest is the submission with least score. I reserve the right to disregard submissions that violate the spirit of this contest or that cheat.

Those are interesting and rather harsh penalties ;-)

@JanDvorak The concept is to encourage people to post incomplete solutions but not to let them intentionally skip parts and take the penalty instead.

Ah I love those puzzles :). You might want to clarify in your post that the yellow lines referred to in the spec are in fact just the grid lines of the complete square grid (you mention the square grid but I don't see any link between that and the yellow lines in your post).

@MartinBüttner If you click the first link in the post, you can see a Javascript puzzle generator. It uses the yellow lines for unknown lines as documented.

@FUZxxl Yes, that's how I figured out what was meant by the yellow lines. But it would be nice if the spec was clear without having to follow any links.

@MartinBüttner Hm... It's hard to understand how these puzzles are supposed to work without trying to solve one anyway.

How are you going to decide which of the "ignores the d parameter" penalties applies? Is there a puzzle hardness checker?

@PeterTaylor "difficult" is a subtle thing. I expect people to be honest and to document that they did not implement this.

There are two very distinct approaches to this challenge: either do a proper (usable) implementation which will become quite long with lots of advanced data structures or a compact brute-force try-and-error version which on the other hand will be very short and can be golfed rather well. Using [tag:code-golf] encourages the latter - while it might be that you want to favour the former version.

@FUZxxl, it's all very well to document that you haven't written a difficulty switch, but you can't expect people who haven't played at least a few dozen puzzles to be able to distinguish an easy one from a hard one.

@PeterTaylor Hm... You might be right. Still, I believe that it's the right thing to mandate a difficulty switch. After all, this is supposed to be a complex challenge.

Perhaps you should have a more defined formula for difficulty, e.g. a 0 difficulty puzzle contains a range of A-B numbers, and the loop is C-D in length.

Python3, 1004 bytes:
from random import*
from itertools import*
R=range
def U(D,B,x,y,X,Y):
 try:D[B[x][y]]=D.get(B[x][y],[])+[B[X][Y]]
 except:1
def O(b,s,e,x,y,n=[],r=[]):
 if[]==s:yield e;return
 j,k=s[0];J,X=j*(y+1)+k,(j+1)*(y+1)+k;K,Y=J+1,X+1
 if len(p:={(J,X),(K,Y),(J,K),(X,Y)}-{*r})>=b[j][k]:
  for i in combinations(p,b[j][k]):
   T=p-{*i}
   if all(q not in n for q in T):
    E=eval(str(e))
    for A,B in T:E[A].remove(B);E[B].remove(A)
    if all(len(E[A])>1 for A in E):yield from O(b,s[1:],E,x,y,n+[*i],r+[*T])
def f(x,y,d):
 while 1:
  s=[0]*(x*y-(L:=int((x*y/2)*d/10)))+[randint(1,3)for _ in R(L)];shuffle(s);b=[s[i:i+y]for i in R(0,len(s),y)];k=-1
  B=[[(k:=k+1)for _ in R(y+1)]for _ in R(x+1)];D={}
  for Y in R(y+1):
   for X in R(x+1):U(D,B,X,Y,X,Y+1);U(D,B,X,Y,X+1,Y);U(D,B,X,Y+1,X,Y);U(D,B,X+1,Y,X,Y)
  for _ in O(b,[(X,Y)for X in R(x)for Y in R(y)if b[X][Y]],D,x,y):return'\n'.join([' '.join(['+']*len(H))+'\n'+' '+' '.join([' ',str(u)][u>0]for u in G)for H,G in zip(B,b)]+[' '.join(['+']*len(B[0]))])

Try it online!
As d increases, the number of numeric cells also increases.

X=j*(y+1)+k,(j+1)*(y+1)+k; can be X=j*-~y+k,-~j*-~y+k;; '\n'+' ' can be '\n '; and in your bottom function you could add a default parameter ,t=' ' and replace the four ' ' with t. 993 bytes

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

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


text:
Validate Loopy Solutions
This is an additional challenge to the generate Loopy puzzles challenge. You might want to solve this challenge before attempting the harder challenge in the previous link.
The goal of this challenge is to validate the solution to a loopy puzzle. Please take all documentation on what a loopy puzzle is from the previous link. A solved loopy puzzle is formatted in a very similar way to the output of a valid submission to the “generate loopy puzzles” challenge and may look like this:
+-+-+ +-+ +-+ +
|   | | |2|3|
+-+ + + + + +-+
 2| | | |2|  3|
+ + +-+ + + +-+
 2|  2 1|3| |
+-+ +-+ +-+ +-+
|2  | |    1 2|
+ +-+ +-+ +-+ +
| |2 1 2|3|3| |
+ + +-+ +-+ +-+
| | |3|2   1
+ +-+ +-+-+-+-+
|        2 2  |
+-+-+-+-+-+-+-+

The path that makes up the solution is marked with | and - characters between the + characters.
Input specification
Your program shall receive a loopy puzzle with a solution formatted like the example above as input. Your program shall infer the size of the puzzle from the input. You may make the following assumptions about the input:

The puzzle has no less than 2 and no more than 99 cells in either direction
Thus, each line has a maximum length of 199 characters not including the newline character(s)
Thus, the input contains a maximum of 99 lines
each line may end after the last printable character or may be padded with whitespace characters so it has a length of up to 2·y + 1 characters where y is the number of cells in horizontal direction
each position with both x and y coordinates even contains a + character
positions horizontally or vertically adjacent to positions containing + characters contain either a whitespace character, are behind the end of line or contain a - character if horizontally adjacent or a | character if vertically adjacent
all other positions are either behind the end of line or contain one of the characters , 0, 1, 2, or 3
all lines are terminated with your platforms default newline character(s)
there is exactly one trailing newline

Input shall be received in one of the following ways:

From standard input
As the value of a parameter named p in an HTTP POST request
As the content of an HTML form
As the content of a file named p in an implementation-defined directory
In an implementation defined way at runtime if the former four are not available
Hard coded if your language provides no mean of receiving input

Output specification
Your program shall terminate for all inputs matching the input specification and shall compute whether the solution to the puzzle is correct. Your program shall output the result of the computation as a boolean value in one of the following ways:

As an exit status of either zero (solution is valid) or non-zero (solution is invalid)
As the character y (solution is valid) or n (solution is invalid) followed by zero or more arbitrary characters output in an implementation defined way

The behaviour of your program is unspecified when encountering input not formatted according to the input specification.
Scoring
The score of your program is the number of characters in its source except for omittable whitespace characters and omittable comments. You are encouraged to indent your submission so it's easier to read for the others and to comment your solution so its easier to follow.
Submissions that fail to follow the input or output specification or generate incorrect results are invalid.

How is input to be handled? Read from a file? STDIN? Can I write a function?

@MartinBüttner "your program shall receive ...". Not sure why'd you like to read from a file.

@MartinBüttner You have to write a complete program. I think the language "your program", "shall terminate", "exit status" is pretty clear.

Also note that in most puzzles 0 is also a valid number for a cell.

@Howard Sorry, missed that.

and here we go... a spec change :-)

@JanDvorak It's not a real spec change because the spec was invalid to begin with.

The previous spec wasn't invalid, it just left a subset of valid puzzles explicitly undefined ;-)

@JanDvorak Yeah, okay. You have a point. I will not change the spec back to the old one though.

@JanDvorak because I think a file will cost me less characters than STDIN, and even so "your program shall receive" does not tell me if via ARGV or STDIN.

GolfScript, 133 characters
'|':^4,{48+.(}%+^*1>.^/'-'*+2/:F;4{{~@@/*}2F//n%zip-1%n*}:X*.'+-'?.3+@/(-2<' 9'+\+'9-+  99|+  9'3/:F;.,4*{X}*.9`?@=\' +09
'-!&'ny'1/=

Expects the input from STDIN and prints y for a valid solution and n for an invalid one. Performs the task by using mostly string-replace on the grid or with rotated versions of the grid.
Annotated code:
# construct the string "|0|/|1|0|2|1|3|2-0-/-1-0-2-1-3-2"
# split into pieces of two and save to variable F
'|':^4,{48+.(}%+^*1>.^/'-'*+
2/:F;

# run the code block X 4 times
# with X: string-replace 1st item in F with 2nd, 3rd with 4th, ...
# i.e. '|0' with '|/', '|1' with '|0'
# and then rotate grid by 90 degrees
4{{~@@/*}2F//n%zip-1%n*}:X*

# for a valid grid all digits are now reduced to exactly '0'
# (i.e. no '1' or '2' or '3' or '/')

# now follow the loop along and remove it
# start: find the first occurence of '+-+' and replace with '+ 9'
# note: '9' is the marker for the current position
.'+-'?
.3+@/(-2<' 9'+\+

# string-replace '9-+' or '9|+' by '  9' (i.e. go one step along the loop)
# using block X enough times
'9-+  99|+  9'3/:F;
.,4*{X}*

# look for the marker '9' in the result and check if it is at the original
# position again
.9`?
@=

# the remaining grid must not contain any digits besides 0 and 9
# esp. no '|' or '-' may remain
\' +09
'-!

# check if both conditions are fulfilled and output corresponding character
&'ny'1/=

C# 803 579bytes
Complete program, reads from STDIN, should cope with any common new-line scheme as long as it has line feeds. Thanks to HackerCow for pointing out that I don't have to append a new line in a different question, prompting me to remove it here and save 4 bytes
Golfed code:
using C=System.Console;class P{static void Main(){var D=C.In.ReadToEnd().Replace("\r","").Split('\n');int w=D[0].Length+2,h=D.Length+1,i=0,j,c,T=0,O=1,o,z,R=0;var B=new int[w,h];var S=new int[w*h*9];for(;i++<w-2;)for(j=0;j<h-2;B[i,j]=c)if((c=(D[j++][i-1]-8)%10)>5){c=5;T++;S[0]=i+j*w;}for(i=0;++i<w-1;)for(j=0;++j<h-1;)R=(i%2+j%2>1&(o=B[i,j-1]%2+B[i-1,j]%2+B[i+1,j]%2+B[i,j+1]%2)>0&o!=2)|((c=B[i,j])<4&c!=o)?7:R;for(o=h=0;o<O;B[i,j]=0)if(B[i=(c=S[o++])%w,j=c/w]>4){h++;S[O++]=(S[O++]=c-w-1)+2;S[O++]=(S[O++]=c+w-1)+2;z=j%2<1?w*2:2;S[O++]=c-z;S[O++]=c+z;}C.Write(h-R<T?"n":"y");}}

The code performs 3 checks, first checking the number of lines around each number and that each junction has 0 or 2 lines leading from it, then that all the lines are joined together.
Formatted code:
using C=System.Console;

class P
{
    static void Main()
    {
        var D=C.In.ReadToEnd().Replace("\r","").Split('\n');
        int w=D[0].Length+2,h=D.Length+1,i=0,j,c,T=0,O=1,o,z,R=0;
        var B=new int[w,h]; // this is the grid
        var S=new int[w*h*9]; // this is a list of joined up lines (stored as x+y*w)

        for(;i++<w-2;)
            for(j=0;j<h-2;B[i,j]=c)
                if((c=(D[j++][i-1]-8)%10)>5)
                { // we are a line
                    c=5;
                    T++; // increment line counter
                    S[0]=i+j*w; // set start of loop
                }

        for(i=0;++i<w-1;) // this loop checks the numbers and that every + has 0 or 2 lines leading from it
            for(j=0;++j<h-1;)
                R=(i%2+j%2>1&(o=B[i,j-1]%2+B[i-1,j]%2+B[i+1,j]%2+B[i,j+1]%2)>0&o!=2)|((c=B[i,j])<4&c!=o)?7:R; // set R to 7 (no significance) if check fails

        for(o=h=0;o<O;B[i,j]=0) // this loops through the list of joined lines adding more until the whole loop has been seen
            if(B[i=(c=S[o++])%w,j=c/w]>4)
            {
                h++; // increment "seen" counter
                S[O++]=(S[O++]=c-w-1)+2;
                S[O++]=(S[O++]=c+w-1)+2;
                z=j%2<1?w*2:2; // special for | and -
                S[O++]=c-z;
                S[O++]=c+z;
            }

        C.Write(h-R<T?"n":"y"); // check if R is greater than 0 or h is less than T and output appropriately
    }
}

Cobra - 514
class P
    def main
        t,m,g=[[1]][:0],nil,File.readAllLines('p')
        u,i=g[0].length,1
        for l in g.length,for c in u,if g[l][c]in'0123'
            n=0
            for j in-1:2:2,for r in[g[l+j][c],g[l][c+j]],if r in'-|',n+=1
            if'[n]'<>g[l][c],m?='n'
        else if g[l][c]in'-|',x,y,t,d=c,l,t+[[c,l]],g[l][c]
        while i
            i=z=6
            for f,b in[[-1,1],[1,1],[0,2],[-1,-1],[+1,-1],[0,-2]]
                if'-'==d,f,b=b,f
                for w in t.count,if z and t[w]==[x+f,y+b],t,x,y,d,z=t[:w]+t[w+1:],x+=f,y+=b,g[y][x],0
                i-=z//6
        print if(t.count,'n',m?'y')

Checks if every number has the right number of lines next to it, and then walks a path around the lines and checks if it missed any.


text:
Extreme Whitewater Canoeing
You are paddling a canoe down a fairly fast whitewater river. Suddenly, your paddles explode, and you find yourself in a dangerous situation hurtling down a river rapid without any paddles. Luckily, you still have your programming skills, so you decide to carve a program on the side of your canoe to help you survive the rapids. However, there is not much surface area on the side of the canoe to write your program with, so you must make the program as short as possible.
The river can be represented as an 8 by 16 grid. We will label the columns with the numbers 0 to 7 and the rows with the numbers 0 to 15.
        y
--------15
--------14
--------13
--------12
--------11
--------10
--------9
--------8
--------7
--------6
--------5
--------4
--------3
--------2
--------1
--------0
01234567
x

Above: A completely calm, ordinary river with no obstructions. Naturally, this is not the river you are on.
You begin at the coordinate (4, 0) and from there move uncontrollably up the river (i.e. the vector (0,1)) until you hit a rock (represented by an o in these examples). When you hit a rock, you will have a 55% chance of moving past the rock to the left (i.e. the vector (-1,1)) and a 45% chance of moving past the rock to the right (i.e. the vector (1,1)). If the canoe is on the far left or right columns, it will always move towards the centre. If there are no rocks, it will move straight upwards.
        y
----x---15
----xo--14
-o--x---13
----x---12
---ox---11
---x----10
---xo---9
---ox---8
----xo--7
-----x--6
----ox--5
-o--x---4
----x---3
----xo--2
----x---1
----x---0
01234567

Above: A possible route the canoe might take, represented using the character x
Given the map of the river, write a program that will output the probability of the canoe finishing at a given column.
Accept input in whichever method is convenient for your program (e.g. STDIN, command line argument, raw_input(), reading from a file, etc). The first part of the input is a single integer from 0 to 7, representing the column the program will find the probability for. Following that is a list of tuples in the form x,y representing the position of the stones.
An example:
Input:
4 4,1 5,5 3,5

This would indicate a river with rocks at the positions (4,1), (5,5), and (3,5), and asks for the probability of the canoe ending at the 4th column.
Output:
0.495

Note that in this example, the positions of the rocks were symmetrical, allowing the problem to be solved with a binomial distribution. This won't always be the case!
Also, the river will always be crossable. That is, there will never be two rocks that are positioned adjacent to each other horizontally. See Glenn's comment for an example of an impossible case.
This is code golf, so lowest number of characters wins. Feel free to ask questions in the comments if the specification isn't clear.

The ironic part is that the program doesn't actually help anyone survive the rapids. It does tell them how likely it is they'll survive though.

What happens when two or more rocks are side-by-side in a row?  e.g., if the map is "0 1,0 1,1" the canoe would crash into the rock at 1,1.  (a) condition is disallowed, or (b) probability of completing the course is 0.

@Glenn Good question. This case will never occur in the input. I'll edit that into the specification.

@Doorknob "If the canoe is on the far left or right columns, it will always move towards the centre" This was supposed to mean that it will always move in the left way if it is on the right column and vice versa. Is it not clear? My English isn't particularly good.

Ah, ok. Sorry, I missed that part.

Related: A mere bagatelle, Where will the ball land?

Final thoughts: "Perhaps building a programmable canoe was not the best solution to the problem of using explosive paddles."

I want to see what it looks like when a paddle explodes.

GolfScript, 105 characters
~](\2/:A;8,{4=}%15,{:B;{20*}%A{~B={[\\,.1,*\[2$=..20/9*:C-\~)C]+(1,\+1,6*2$8>+]zip{{+}*}%.}*;}/}/=20-15?*

A GolfScript version which became much longer than intended - but each attempt with a different approach was even longer. The input must be given on STDIN.
Example:
> 4 4,1 5,5 3,5
99/200

Annotated code:
# Evaluate the input
#  - stack contains the first number (i.e. column)
#  - variable A contains the rock coordinates (pairs of X y)
#    where X is an array of length x (the coordinate itself)
~](\2/:A;

# Initial probabilities
#  - create array [0 0 0 0 1 0 0 0] of initial probabilities
8,{4=}%

# Loop over rows
15,{:B;           # for B = 0..14
  {20*}%          #   multiply each probability by 20
  A{              #   for each rock
    ~B={          #     if rock is in current row then
                  #       (prepare an array of vectors [v0 vD vL vR]
                  #       where v0 is the current prob. before rocks,
                  #       vD is the change due to rocks,
                  #       vL is a correction term for shifting out to the left
                  #       and vR the same for the right side)
      [\\         #       move v0 inside the array
      ,           #       get x coordinate of the rock
      .1,*        #       get [0 0 ... 0] with x terms
      \[2$=       #       get x-th item of v0
      ..20/9*:C-  #       build array [0.55P -P 0.45P]
      \~)C]+      #       and append to [0 0 ... 0]
      (1,\+       #       drop the leftmost item of vD and prepend [0] again
                  #       which gives vL
      1,6*2$8>+   #       calculate vR using the 8th item of vD
      ]           #
      zip{{+}*}%  #       sum the columns of this list of vectors
      .           #       dummy dup for end-if ;
    }*;           #     end if
  }/              #   end for
}/                # end for

# take the n-th column and scale with 20^-15
=
20-15?*

Ruby, 204 191 172 characters
c,*r=gets.split
o=[0]*8
s=->x,y,p{y>14?o[x]+=p :(r.index("#{x},#{y+=1}")?(x<1?s[x+1,y,p]:(x>6?s[x-1,y,p]:(s[x-1,y,p*0.55]+s[x+1,y,p*0.45]))):s[x,y,p])}
s[4,0,1]
p o[c.to_i]

It recursively simulates all possibly outcomes while keeping track of each individual outcome's probability, then it adds that probability to a cumulative counter when y == 15.
Fancy tricks:

c,*r=gets.split - the "splat" operator (*) takes all the remaining elements of gets.split and sticks them in the r array
next {something} if {condition}: essentially equivalent to
if {condition}
    {something}
    return
end

"Discovered" by evolving from if condition; something; return; end to return something if condition to break something if condition, and then I figured I would try a shorter "loop operator" to see if it would work (which it did, of course).
Thanks to @MartinBüttner for suggesting to use chained ternary operators (which ended up becoming the enormous third line in the golfed code above) and eliminating the above point (which saved 19 (!) characters).
I did use a somewhat fancy trick with those, though: I realized that s[foo],s[bar] doesn't work in Ruby for two method calls in one statement. So at first I changed it to (_=s[foo],s[bar]) (a dummy variable), but then I realized I could just add and throw away the return values: s[foo]+s[bar]. This only works because calls to s will only ever "return" other calls to s or a number (o[x]+=p), so I don't have to worry about checking for nil.
Other various optimizations: p instead of puts for printing numbers, <1 instead of ==0 (since the canoe never leaves the river) and similar comparisons elsewhere, [0]*8 for initial probabilities as Ruby's numbers are always "pass by value"

Ungolfed:
column, *rocks = gets.chomp.split
outcomes = Array.new(8, 0)
simulate = -> x, y, probability {
    if y == 15
        outcomes[x] += probability
    elsif rocks.index("#{x},#{y + 1}")
        case x
        when 0 then simulate[x + 1, y + 1, probability]
        when 7 then simulate[x - 1, y + 1, probability]
        else
            simulate[x - 1, y + 1, probability * 0.55]
            simulate[x + 1, y + 1, probability * 0.45]
        end
    else
        simulate[x, y + 1, probability]
    end
}
simulate[4, 0, 1.0]
p outcomes
puts outcomes[column.to_i]

Wouldn't it still be shorter to collect all of those next X if Y into nested ternary operators? Nice find though, you might want to add it to the Ruby tips!

@MartinBüttner Yep, that's actually a whopping 19 characters shorter! Thanks, although it does have the unfortunate side effect of a ridiculously long line :P

C# 418 364bytes
Complete C# program expecting input from STDIN. Works by reading the rocks into an array of all locations in the river, effectively creating a map, and then it just performs 16 iterations of moving probabilities around an 8-width decimal array before outputting the result.
using C=System.Console;class P{static void Main(){var D=C.ReadLine().Split();int i=0,j=D.Length;var R=new int[8,16];var p=new decimal[8];for(p[4]=1;--j>0;)R[D[j][0]-48,int.Parse(D[j].Substring(2))]=1;for(;i<16;i++){var n=new decimal[j=8];for(;j-->0;)if(R[j,i]>0){n[j<1?1:j-1]+=p[j]*0.55M;n[j>6?6:j+1]+=p[j]*0.45M;}else n[j]+=p[j];p=n;}C.WriteLine(p[D[0][0]-48]);}}

Formatted code:
using C=System.Console;

class P
{
    static void Main()
    {
        var D=C.ReadLine().Split();
        int i=0,j=D.Length;
        var R=new int[8,16];
        var p=new decimal[8];

        for(p[4]=1;--j>0;) // read rocks into map (R)
            R[D[j][0]-48,int.Parse(D[j].Substring(2))]=1;

        for(;i<16;i++) // move up the river
        {
            var n=new decimal[j=8];
            for(;j-->0;)
                if(R[j,i]>0)
                { // we hit a rock!
                    n[j<1?1:j-1]+=p[j]*0.55M;
                    n[j>6?6:j+1]+=p[j]*0.45M;
                }
                else
                    n[j]+=p[j];
            p=n; // replace probability array
        }

        C.WriteLine(p[D[0][0]-48]); // output result
    }
}

+1 for using the "goes to" operator (for(;j-->0;)). You can get rid of a couple of characters though by replacing the last C.WriteLine by C.Write. Also, if you use float instead of decimal you can save a couple more bytes.

@HackerCow standard practice ;) got to get the most out of your for-loops! I'm using decimal because float won't be precise, but decimal should do for these problems, but could probably get away with it as you say. I'll put in C.Write if I do manage to golf this any further as it's probably closer to the spec than C.WriteLine as I don't think 4 bytes warrants an edit for this size program ;)

PHP, 358
Using brainpower to determine the possible paths and their probabilities is hard, and would probably require more code than simply simulating 1,000,000 canoe accidents. Oh, the humanity!
define('MX',7);
define('MY',16);
define('IT',1000000);
error_reporting(0);

function roll(){return rand()%100 > 44;}

function drift($rocks,$print=false) {
    for($px=4,$py=0;$py<MY;$py++) {
        if(isset($rocks[$px][$py])){
            if(roll()) $px--;
            else $px++;
        }
        else if($px==0) $px++;
        else if($px==MX) $px--;
        if($print) {
            for($i=0;$i<MX;$i++){
                if($i==$px) echo 'x';
                else if(isset($rocks[$i][$py])) echo 'o';
                else echo '-';
            }
            echo " $py\n";
        }
    }
    return $px;
}

$input = $argv[1];
$tmp = explode(' ',$input);
$end_target = array_shift($tmp);
$rocks = array();
array_map(function($a) use(&$rocks) {
    list($x,$y) = explode(',',$a);
    $rocks[$x][$y]=1;
}, $tmp);

$results=array();
for($i=0;$i<IT;$i++) {
    $results[drift($rocks)]++;
}

drift($rocks, true); // print an example run

foreach($results as $id=>$result) {
    printf("%d %0.2f\n", $id, $result/IT*100);
}

Example:
php river.php "4 4,1 5,5 3,3 6,2 9,4 12,3 13,5"
----x-- 0
---xo-- 1
---x--o 2
--xo--- 3
--x---- 4
--x--o- 5
--x---- 6
--x---- 7
--x---- 8
--x---- 9
--x---- 10
--x---- 11
--x---- 12
--x---- 13
--x---- 14
--x---- 15
4 49.53
2 30.18
6 20.29

Golfed:
<? function d($r){for($x=4,$y=0;$y<16;$y++){if(isset($r[$x][$y])){if(rand()%100>44)$x--;else $x++;}elseif($x==0)$x++;elseif($x==7)$x--;}return $x;}$t=explode(' ',$argv[1]);$e=array_shift($t);$r=array();array_map(function($a)use(&$r){list($x,$y)=explode(',',$a);$r[$x][$y]=1;},$t);$c=0;for($i=0;$i<1000000;$i++){if(d($r)==$e)$c++;}printf("%.4f", $c/1000000);

This version does not do any pretty printing and outputs the float probability of the canoe landing at the specified position.
# php river_golf.php "4 4,1 5,5 3,3 6,2 9,4 12,3 13,5"
0.4952

I think the input format here is slightly off, e.g. river.php should give 0.561375 on "5 4,4 1,5 5,3 3,6 2,9 4,12 3,13"

@MattNoonan it was a rough day yesterday. I should be able to fix that...

PHP, 274
I can't read/write GolfScript to save my life, but glancing over @Howard's submission pointed me in a better direction than simply simulating 1 million canoe accidents.
Starting with an array of probabilities for starting positions we can simply split those numbers each time a rock is encountered.
function psplit($i){ return array(.55*$i,.45*$i); }
function pt($a) {
    foreach($a as $p) {
        printf("%1.4f ", $p);
    }
    echo "\n";
}

$input = $argv[1];
$tmp = explode(' ',$input);
$end_target = array_shift($tmp);
$rocks = array();
array_map(function($a) use(&$rocks) {
    list($x,$y) = explode(',',$a);
    $rocks[$x][$y]=1;
}, $tmp);

$state = array(0,0,0,0,1,0,0,0);
pt($state);
for($y=1;$y<16;$y++){
    for($x=0;$x<8;$x++){
        if(isset($rocks[$x][$y])){
            echo('   o   ');
            list($l,$r)=psplit($state[$x]);
            $state[$x]=0;
            $state[$x-1]+=$l;
            $state[$x+1]+=$r;
        } else { echo '   -   '; }
    }
    echo "\n";
    pt($state);
}

Example Output:
# php river2.php "4 4,1 5,5 3,3 6,2 9,4 12,3 13,5"
0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000
   -      -      -      -      o      -      -      -
0.0000 0.0000 0.0000 0.5500 0.0000 0.4500 0.0000 0.0000
   -      -      -      -      -      -      o      -
0.0000 0.0000 0.0000 0.5500 0.0000 0.4500 0.0000 0.0000
   -      -      -      o      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.2475 0.4500 0.0000 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.2475 0.4500 0.0000 0.0000
   -      -      -      -      -      o      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000
   -      -      -      -      -      -      -      -
0.0000 0.0000 0.3025 0.0000 0.4950 0.0000 0.2025 0.0000

Golfed:
<? $t=explode(' ',$argv[1]);$e=array_shift($t);$r=array();foreach($t as $n){list($j,$k)=explode(',',$n);$r[$j][$k]=1;}$s=array(0,0,0,0,1,0,0,0);for($y=1;$y<16;$y++){for($x=0;$x<8;$x++){if(isset($r[$x][$y])){$s[$x-1]+=$s[$x]*.55;$s[$x+1]+=$s[$x]*.45;$s[$x]=0;}}}echo $s[$e];

Example run:
# php river2_golf.php "4 4,1 5,5 3,3 6,2 9,4 12,3 13,5"
0.495

Haskell, 256 bytes
import Data.List
m=map;v=reverse
a p n x=take n x++(x!!n+p:drop(n+1)x)
l=abs.pred
o[_,n]s=n#(s!!n)$s
n#p=a(11*p/20)(l n).a(9*p/20)(7-(l$7-n)).a(-p)n
b=0:0:0:0:1:b
k(c:w)=(foldl1(.)$m o$v$sort$m(v.read.('[':).(++"]"))w)b!!read c
main=getLine>>=print.k.words

Here is a very ungolfed version along with some tricks that were used:
import Data.List

-- Types to represent the distribution for the canoe's location
type Prob = Double
type Distribution = [Prob]

-- Just for clarity..
type Index = Int

-- An Action describes some change to the probability distribution
-- which represents the canoe's location.
type Action = Distribution -> Distribution

-- Helper to add k to the nth element of x, since we don't have mutable lists.
add :: Index -> Prob -> Action
add n k x = take n x ++ [p] ++ drop (n + 1) x
    where p = k + x!!n

-- A trick for going finding the index to the left of n,
-- taking the boundary condition into account.
leftFrom n = abs (n - 1)

-- A trick for getting the other boundary condition cheaply.
rightFrom = mirror . leftFrom . mirror
    where mirror = (7 -)

-- Make the action corresponding to a rock at index n.
doRock :: Index -> Action
doRock n p = (goLeft . goRight . dontGoForward) p
    where goLeft  =  (leftFrom n) `add` (p_n * 11/20)
          goRight = (rightFrom n) `add` (p_n * 9/20)
          dontGoForward =  (at n) `add` (-p_n)
          p_n = p!!n
          at = id

initialProb = [0,0,0,0,1,0,0,0]

-- Parse a pair "3,2" ==> (3,2)
readPair :: String -> (Index,Index)
readPair xy = read $ "(" ++ xy ++ ")"

-- Coordinate swap for the sorting trick described below.
swap (x,y) = (y,x)

-- Put it all together and let it rip!
main = do
    input <- getLine
    let (idx : pairs) = words input
    let coords = reverse . sort $ map (swap . readPair) pairs
    let rockActions = map (doRock . snd) coords
    let finalProb = (foldl1 (.) rockActions) initialProb
    print $ (finalProb !! read idx)

The last trick I used was to note that you can act as if rocks in a single row are actually separated by some infinitesimal amount. In other words, you can apply the probability distribution transformer for each rock in the same row sequentially and in whatever order you want, rather than applying them all simultaneously. This only works because the problem disallows two horizontally adjacent rocks.
So the program turns each rock's location into a probability distribution transformer, ordered by the rock's y coordinate. The transformers are then just chained in order and applied to the initial probability distribution. And that's that!

Haskell, 237
I just hope the canoe comes with ghc installed...
The trick with the infinite list is stolen from Matt Noonan, kudos to him!
import Data.List
r=reverse
(a:b:x)%0=0:a+b:x
x%7=r(r x%0)
x%n=take(n-1)x++(x!!(n-1)+x!!n*0.55:0:x!!(n+1)+x!!n*0.45:drop(n+2)x)
q=0:0:0:0:1:q
u(w:x)=(foldl(%)q.map last.sort.map(r.read.('[':).(++"]"))$x)!!read w
main=interact$show.u.words

I hope I got the logic right, but Matt's example "5 4,4 1,5 5,3 3,6 2,9 4,12 3,13" yields 0.5613750000000001 and OP's example "4 4,1 5,5 3,5" yields 0.49500000000000005, which seems to be correct apart from some floating point errors.
Here it is in action:
>>> echo 5 4,4 1,5 5,3 3,6 2,9 4,12 3,13 | codegolf
0.5613750000000001

Perl 169 Bytes
Reads from STDIN.
$_=<>;s/ (.),(\d+)/$s{$1,$2}=1/eg;/./;$x{4}=1.0;for$y(1..15){for$x(0..7){if($s{$x,$y}){$x{$x-1}+=$x{$x}*($x%7?.55:1);$x{$x+1}+=$x{$x}*($x%7?.45:1);$x{$x}=0}}}print$x{$&}

Pretty straight forward, implicitly uses columns -1 and 8 to smoothen border cases. Probabilities can safely be propagated to each next level because there arent any adjacent stones, thus a single run suffices.