text:
Please parse this aLL1en language
Background
Due to some unfortunate accident during coding you are now teleported and stranded on an alien planet. You really hope that the locals will be helpful and point to the general direction of how to get home, but before trying to talk to them you want to decipher their language. Fortunately it looks like the aliens were expecting this, and are actually displaying the grammar of their language near the place you got teleported.
Your task
Your job is to write an LL(1) parser, that can determine whether a specific string belongs to the specified grammar or not and also return the rules that were used during parsing. Your fingers are a bit strained because of the teleporting, so you want to code this parser in as less characters as possible.
Also it looks like for some weird reason there is free wifi there, but only wikipedia is available, so if you need help you can check how to parse an LL(1) grammar and how to create the parsing table for it.
Input
The first line of the input is the string you need to parse. The following lines will all include the available rules of the grammar, where the first character is the left hand side of the rule, and the rest of the line is the right hand side of the rule.
Example input:
(a+a)
SF
S(S+F)
Fa

Which describes that you have to determine whether ( a + a ) is part of the following grammar or not:
S → F
S → ( S + F )
F → a

Notes on the input:

The grammar might contain empty (epsilon) rules, here the the right hand side is empty
All terminals and non terminals occupy exactly one character
Terminals are the following characters: abcdefghijlkmnopqrstuvwxyz+-/*^%=()[]{}
Non Terminals are the following characters: ABCDEFGHIJKLMNOPQRSTUVWXYZ
The starting non terminal is always S
You can assume that the grammar in the input is always a proper LL(1) grammar
A trailing newline may or may not be present, your choice.

Output
The output should contain whether the string is part of the grammar or not, and if it is, it should also include the rules you had to use for parsing.
Example output for the input above:
true
S(S+F)
SF
Fa
Fa

Variations on the output is allowed as long as it returns all information required. For example the following output is considered accepted as well: 1 [2,1,3,3] (1 because the string is accepted, then [2,1,3,3] are the rules used as an array, where each element represents the index of the rule in the input starting from one)
Scoring
You have to write either a complete program (reading from STDIN) or a function (reading from a string). The output can either be done to STDOUT, or returned from the function in an appropriate way (like a Pair<bool,int[]>).
Your point score is the byte count of the program, with the following penalties:

Add 10 to the byte count and square it, in case you are using a built in LL(1) parser of your chosen language
Add 100 to the byte count and square it, in case you are using a built in LL(2+), LR(1), LALR, SLR, or any other more advanced parser than LL(1)
Although they might not be more advanced than an LL(1), use the previous penalty if you are using regular expression features which are not considered part of a regular grammar

(these penalties apply, since the teleporter messed up these built in functions a bit, and you have to magically fix them first)
Note:
Normal regular expressions are allowed and don't count into the penalty, unless you use advanced regexp features which make your expression not a regular grammar anymore. Also using a built in LR(0) parser is okay (but probably not very helpful)
Lowest points win.
If your language is not character based use the appropriate metric for your language and then apply the penalties on the resulting number. Standard loopholes apply, but solutions where the language was updated since the post was posted are allowed given you add the proper disclaimer to your post.
Examples
In:
(a+a)
SF
S(S+F)
Fa

Out: 1 [2,1,3,3]
In:
(aa)
SF
S(S+F)
Fa

Out: 0
In:
a*(a+a)
STE
E+TE
E
TFU
U*FU
U
F(S)
Fa

Out: 1 [1,4,8,5,7,1,4,8,6,2,4,8,6,3,6,3]
In:
aaabbb
SaA
AaAb
Ab

Out: 1 [1,2,2,3]
In:
aabbb
SaA
AaAb
Ab

Out: 0
In:
aaabb
SaA
AaAb
Ab

Out: 0

If you want to solve this challenge you should solve this one first.

JavaScript (ES6), 177 bytes
177 looks like LL1 rotated 177°, so I stopped golfing.
s=>(f=(x,i)=>x<"A"||x>"Z"?v=s[i]==x&&[i+1,x]:s.split`
`.some((r,a,j)=>v=r[0]==x&&[j=i,a=[a],...r].slice(3).every(y=>f(y,j)&&a.push(([j]=v)[1]))&&[j,a]))("S",0)&&s[v[0]]==0&&v[1]

Try it online!
Outputs false if the string does not match, otherwise outputs a nested array of rule indices and terminals:
[2,"(",[1,[3,"a"]],"+",[3,"a"],")"]

Ungolfed
str =>
  (applyRule = (ruleName, index) =>
    ruleName < "A" || ruleName > "Z"
      ? result = str[index] == ruleName && [index + 1, ruleName]
      : str.split("\n").some(
        (rule, appliedRules, jndex) => result =
          rule[0] == ruleName &&
          (
            jndex = index,
            appliedRules = [appliedRules],
            [...rule].slice(1).every(char =>
              applyRule(char, jndex)
              && appliedRules.push(([jndex] = result)[1])
            )
            && [jndex, appliedRules]
          )
      )
  )("S", 0)
  && str[result[0]] == 0 // "\n" == 0
  && result[1]

function main(input) {
  const [str, ...rules] = input.split("\n")

  const result = applyRule("S", 0)

  if(result && result[0] === str.length)
    return result[1]

  function applyRule(ruleName, index) {
    if (ruleName === ruleName.toLowerCase())
      return str[index] === ruleName ? [index + 1, ruleName] : null

    main: for (const [ruleIndex, rule] of rules.entries()) {
      if (!rule.startsWith(ruleName))
        continue
      let curIndex = index
      let appliedRules = [ruleIndex + 1]
      for (const char of rule.slice(1)) {
        let result = applyRule(char, curIndex)
        if (!result) continue main
        curIndex = result[0]
        appliedRules.push(result[1])
      }
      return [curIndex, appliedRules]
    }

    return null
  }
}

NIce answer! It's fine to use languages/versions of languages that were made after a challenge now, you don't need the asterisk. If you want to, you can specify that this uses ES2017 or whatever version is needed to make it work.

@user I only added the asterisk due to the "solutions where the language was updated since the post was posted are allowed given you add the proper disclaimer to your post" blurb in the question, but if you think it's fine to remove it, I will.

Oh, I didn't see that. It's probably fine either way - the question's quite old.

Yeah it's fine, I can update the post

Python3, 672 bytes
E=enumerate
def F(b,g):
 if not b[0].isupper():yield b[0]
 for a,*B in g:
  if b[0]==a:yield from F(B*(B!=[' '])+b[1:],g)
def T(a,g):
 q=[(a,b,[])for A,*b in g if A==a]
 for A,b,s in q:
  for i,j in enumerate(b):
   if j==a and b[i+1:]and not b[i+1].isupper():yield b[i+1]
   for J,*k in g:
    if j==J and j not in s:q+=[(J,b[:i]+k*(k!=[' '])+b[i+1:],s+[j])]
def f(g):
 l,*g=g
 D={i[0]:{}for i in g}
 for i,(a,*b)in E(g):
  K=[*F(b,g)]
  for j in K:D[a][j]=i
  if' 'in K:
   for j in{*T(a,g)}:D[a][j]=i
 q,R=['S'],[]
 l+=[' ']
 while q:
  a,b=q.pop(0),l.pop(0)
  if a!=b:
   if a not in D:return
   q=[t for t in g[D[a][b]][1:]if' '!=t]+q;l=[b]+l;R+=[D[a][b]+1]
 return R

Try it online!


text:
Caesar Shifting
A Caesar shift is probably something we're all familiar with.
(You might be even doing it as a homework task. If so, please don't copy these answers, your teacher almost certainly doesn't want anything like the answers here.)
Just in case you aren't, a Caesar shift is a very simple form of cipher. It takes a string to be ciphered and an integer. Then for every alphabetical character in the string, perform the following transformation:

Work out the character's position in the alphabet (0 based).
Add to that number the integer received at the beginning.
While the number is bigger than 25, subtract 26 from it.
Work out the position of the alphabet it is in.

Leave the rest of the characters unshifted.
Capital letters have to be respected because what is English without capital letters?
Examples:
abcdefghijklmnopqrstuvwxyz 1 -> bcdefghijklmnopqrstuvwxyza
Spam spam spam sausage and spam! 13 -> Fcnz fcnz fcnz fnhfntr naq fcnz!
abcdefghijklmnopqrstuvwxyz 52 -> abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz -1 -> zabcdefghijklmnopqrstuvwxy
ABCxyz 3 -> DEFabc

Assumptions

You may receive any printable ASCII character
The input number can be negative and will always be bigger than -128 and less then 128 (-128<x<128)
You must be able to encode capital letters and non-capital letters reversibly.
You must create a full program, not just a function or snippet
You will get your input from STDIN or closest alternate
You may choose the format for your input, please state this in your answer
The characters that need to be shifted are ASCII codepoints 0x41 - 0x5A and 0x61-0x7A - upper and lower case letters

Upper case letters should stay upper
Lower case letters should stay lower
Characters not in this range should be left as they are

Note for this challenge, you only have to cipher strings, you don't have to be able to solve them automatically (but giving -x will reverse the cipher)

Since this is a catalog, languages created after this challenge are allowed to compete. Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language. Other than that, all the standard rules of code-golf must be obeyed. Submissions in most languages will be scored in bytes in an appropriate preexisting encoding (usually UTF-8).
Catalog
The Stack Snippet at the bottom of this post generates the catalog from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
## Language Name, N bytes

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

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

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

"You might be even doing it as a homework task. If so, please don't copy these answers, your teacher almost certainly doesn't want anything like the answers here." I wonder what would happen if you handed a teacher a 90-byte kludge of messy characters and shortcuts...

Pyth, 13 bytes
uXGH.<HQrBG1z

Test suite
Basically, we start with the two strings we want to caesar shift, the lowercase and uppercase alphabets. The list containing both of these is generated by rBG1, bifurcate on uppercase. Then, we reduce over this list, starting with the input string and translating first lowercase, then uppercase letters by the appropriate shift.

Very nice, I keep forgetting bifurcation exists... :P

Pyth, 16
XXzG.<GQJrG1.<JQ

Try it online or run a Test Suite

+1 for Star Wars input, even though I hate esolangs.

Bash + bsd-games package, 21
caesar $[($1+130)%26]

Builtins FTW!  Almost feels like Mathematica.  Pyth answers are still shorter though.
Input string read from STDIN and integer from command-line.  e.g.:
$ ./caesar.sh 13 <<< "Spam spam spam sausage and spam!"
Fcnz fcnz fcnz fnhfntr naq fcnz!
$

Or if you don't like the builtin:
Bash + coreutils, 63
printf -va %s {a..z}
t=${a:$1%26}${a:0:$1%26}
tr A-Z$a ${t^^}$t

It seems to me that the coreutils version doesn't work with -127 and/or 127?

@Neil Yes. Good catch.  Fixed.

JavaScript (ES6), 122 118 114 111 bytes
alert((p=prompt)().replace(/[a-z]/gi,c=>String.fromCharCode((x=c.charCodeAt(),a=x&96,x-a+n+129)%26-~a),n=+p()))

Saved 4 bytes thanks to @Neil!
Explanation
First prompt takes the input string. The second is the number to shift each letter by.
alert(
  (p=prompt)()              // get input string
    .replace(/[a-z]/gi,c=>  // for each letter
      String.fromCharCode((
        x=c.charCodeAt(),   // x = code of character
        a=x&96,             // a = index of letter a (-1) in same capitalisation
        x-a+n+129)%26-~a    // add N to the letter code and wrap at 26
      ),                    // (+129 is needed to make the % work with negative numbers)
      n=+p()                // get number to shift by
    )
)

Very nice! But it doesn't work on all inputs; try "abcdefg", -26. This can be fixed by changing the formula to (x-a+n+130)%26.

@ETHproductions Thanks for catching that!

"You must create a full program, not just a function or snippet"

@LegionMammal978 Thanks, I didn't notice that.

Does a=x&96,(x-a+n+129)%26+a+1 help?

@Neil Yes it does. :) Thanks!

I changed the 130 to 129 but you made that unnecessary with the ++a. When you change it back, there might be another byte saving you can make - instead of n+130 write n=130+p().

@Neil Oh, I'm not sure what I was thinking there. I think 130+p() would cast n to a string (entering 3 would make n equal 1303!). But I had another idea to save a few bytes.

I can never remember those coercion rules, but I like the +a+1 to -~a change.

CJam, 34 22 21 20 bytes
Thanks to FryAmTheEggman for saving 1 byte.
l'[,_el^_26/l~fm<ser

Test it here.
Input is the string to be shifte on the first line and the shift on the second.
Explanation
l    e# Read the first line of input.
'[,  e# Push a string with all ASCII characters up to and including Z.
_el  e# Duplicate and convert to lower case. This only affects the letters.
^    e# Symmetric set-difference: except for the letters, each character appears in both
     e# sets and will be omitted from the difference, but all the letters will be included.
     e# This gives us "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".
_26/ e# Duplicate and split into chunks of 26 characters, separating lower and upper case.
l~   e# Read the second line of input and evaluate.
fm<  e# Shift each of the two substrings by that many characters to the left.
s    e# Convert to a single string, joining both substrings back together.
     e# On the stack are now the input, the letters in alphabetical order and the letters
     e# in shifted order.
er   e# Character transliteration: replace each occurrence of a letter with the character
     e# at the corresponding position in the shifted string.

@FryAmTheEggman The '[,_el^ is a tip from Dennis. I don't know what you mean about f though, it seems like fairly normal usage?

I guess I just haven't read enough CJam answers :P It just seems really neat to use it as like a map but change argument order.

@FryAmTheEggman actually, I don't need the @ at all. :)

Java, 249 Bytes
This is as short as I could get it. Reading from stdin eats a ton of bytes. A solution using command line args is noticeably shorter but, this task specified stdin for input.
Input format is the String first followed by the shift number on a new line.
interface C{static void main(String[]a){java.util.Scanner r=new java.util.Scanner(System.in);String s=r.nextLine();int i=(r.nextInt()+26)%26;s.chars().forEach(c->System.out.print((char)(c>64&c<91|c>96&c<123?c<91?65+(c+i-65)%26:97+(c+i-97)%26:c)));}}

Using command line Arguments this solution is only 188 bytes. Input is the String as the first argument and the shift as the second.
interface C{static void main(String[]a){int i=(Integer.parseInt(a[1])+26)%26;a[0].chars().forEach(c->System.out.print((char)(c>64&c<91|c>96&c<123?c<91?65+(c+i-65)%26:97+(c+i-97)%26:c)));}}

R, 111 bytes
code
n=scan();s=scan(,"");for(l in as.numeric(sapply(s,charToRaw))){v=97;if(l<97)v=65;cat(intToUtf8((l+n-v)%%26+v))}

ungolfed
n <- scan()                           # input integer
s <- scan(,"")                        # input string letter by letter
z <- as.numeric(sapply(s,charToRaw))  # get ASCII index of character
for (l in z){                         # loop through chars
  v=97                                # base index of not capitalized chars
  if(l<97)v=65                        # base index of capitalized chars
  cat(intToUtf8((l+n-v)%%26+v))       # paste the char of the shifted index
}

This program takes the user input from STDIN, first the integer shifter and then the string, character by character.

Perl, 81 bytes
(+1 for the -p flag)
s/[^ ]+ //;$n=$&%26;eval"y/a-zA-Z/".($x=chr(97+$n)."-za-".chr$n+96).uc$x."/"if$n

Still working on golfing it down...
Test:
llama@llama:...code/perl/ppcg67044caesar$ printf '1 abcdefghijklmnopqrstuvwxyz\n13 Spam spam spam sausage and spam!\n52 abcdefghijklmnopqrstuvwxyz\n-1 abcdefghijklmnopqrstuvwxyz\n3 ABCxyz' | perl -p caesar.pl; echo
bcdefghijklmnopqrstuvwxyza
Fcnz fcnz fcnz fnhfntr naq fcnz!
abcdefghijklmnopqrstuvwxyz
zabcdefghijklmnopqrstuvwxy
DEFabc

Python 2, 163 160 bytes
Not sure if I can still golf it down..
import sys;k=sys.argv
def f(x,n):r=chr((ord(x.lower())-97+n)%26+97);return(x,[r,r.upper()][x.isupper()])
print''.join(f(x,int(k[2]))[x.isalpha()] for x in k[1])

Since it's pretty unreadable, here is an ungolfed version:
import sys

def shift(x,n):
    # shift character x by n (all in lowercase)
    r = chr((ord(x.lower())-97+n)%26+97)
    if x.isalpha() and x.islower():
        return r
    elif x.isalpha() and x.isupper():
        return r.upper()
    else:
        return x

# 'map' the function shift to each character of the input
output = ''.join(shift(x,int(sys.argv[2])) for x in sys.argv[1])
print(output)

Concerning the input: It expects two arguments, the first must be a string and the second an integer (the shift amount).
Examples (file is called csr.py):
$ python csr.py gnu 9
pwd
$ python csr.py "Spam spam spam sausage and spam\!" 13
Fcnz fcnz fcnz fnhfntr naq fcnz!

Note: In the second example an escape character and "" are needed

Japt, 45 43 bytes
Ur"[^\\W_]"_c +V+#¶-(A=Zc <#a?#A:#a)%26+A d

Try it online!

Python 2, 118 116 bytes
s,n=input()
print''.join([[c,chr((ord(c)-97+n)%26+97)]['`'<c<'{'],chr((ord(c)-65+n)%26+65)]['@'<c<'[']for c in s)

You might want to use lists instead of the if/else instances (http://codegolf.stackexchange.com/a/62/36885 ). For example, print''.join([[c,chr((ord(c)-97+n)%26+97)]['~'<c<'{'],chr((ord(c)-65+n)%26+65)]['@'<c<'[']for c in s) is a little shorter, and should work the same. (Except change the tilde to a backtick like you had before--I couldn't get the backtick to display right.)

Mathematica, 117 bytes
Echo[InputString[]~StringReplace~Thread[Join[a=Alphabet[],b=ToUpperCase@a]->(c=RotateLeft)[a,d=Input[]]~Join~c[b,d]]]

Takes the string, followed by a newline, followed by the shifting factor. Might still be golfable...

Perl 6, 73+1 = 74 bytes
$ perl6 -pe 's:g:i/<[a..z]>/{chr ((my$o=ord ~$/)-(my$a=$o+&96+1)+BEGIN get%26)%26+$a}/' # 73+1

The first line of input is the number of characters to shift the letters up by.
Usage:
$ perl6 -pe 's:g:i/<[a..z]>/{...}/' <<< \
'1
abcdefghijklmnopqrstuvwxyz'
bcdefghijklmnopqrstuvwxyza

$ perl6 -pe 's:g:i/<[a..z]>/{...}/' <<< \
'13
Spam spam spam sausage and spam!'
Fcnz fcnz fcnz fnhfntr naq fcnz!

$ perl6 -pe 's:g:i/<[a..z]>/{...}/' <<< \
'52
abcdefghijklmnopqrstuvwxyz'
abcdefghijklmnopqrstuvwxyz

$ perl6 -pe 's:g:i/<[a..z]>/{...}/' <<< \
'-1
abcdefghijklmnopqrstuvwxyz'
zabcdefghijklmnopqrstuvwxy

$ perl6 -pe 's:g:i/<[a..z]>/{...}/' <<< \
'3
ABCxyz'
DEFabc

$ perl6 -pe 's:g:i/<[a..z]>/{...}/' <<< \
'1000000000000000000000000000000000000000
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ'
mnopqrstuvwxyzabcdefghijkl
MNOPQRSTUVWXYZABCDEFGHIJKL

C++, 163 154 152 bytes
#include<cstdio>
#include<cstdlib>
int main(int x,char**a){for(int c,b,s=atoi(a[1]);1+(c=getchar());putchar(cb+26?c:(c+s-b+26)%26+b))b=c<97?65:97;}

Usage:
$ ./caesar -1 <<< "123 a A z Z aBcDeFgHiKlMnOpQrStUvWxYz"
123 z Z y Y zAbCdEfGhJkLmNoPqRsTuVwXy

k4, 80 bytes
The program accepts the shift number as a command-line argument and reads text from stdin.
Due to a technical constraint, negative shifts must be encoded with an underscore instead of a hyphen-minus. (Without the parser for interpreting this encoding, the solution would be 64 bytes.)
% wc -c c.k
80 c.k
% cat c.k
c:{x;,/x{y!(x_y),x#y}'.Q`a`A}
.z.pi:{1@x^c[.q.mod[.*{x^((!).$"_-")x}.z.x]26]x;}
%

Here's the examples executed:
% echo abcdefghijklmnopqrstuvwxyz|q c.k 1
bcdefghijklmnopqrstuvwxyza
% echo 'Spam spam spam sausage and spam!'|q c.k 13
Fcnz fcnz fcnz fnhfntr naq fcnz!
% echo abcdefghijklmnopqrstuvwxyz|q c.k 52
abcdefghijklmnopqrstuvwxyz
% echo abcdefghijklmnopqrstuvwxyz|q c.k _1
zabcdefghijklmnopqrstuvwxy
% echo ABCxyz|q c.k 3
DEFabc
%

And here's a silly little test harness that verifies both encode and decode. (This is zsh; for bash or ksh, change the for loop indexing to ((i=0;i<5;i++)). One-based arrays, ugh....)
% a=(abcdefghijklmnopqrstuvwxyz 'Spam spam spam sausage and spam!' abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz ABCxyz)
% b=(1 13 52 _1 3)
% c=(bcdefghijklmnopqrstuvwxyza 'Fcnz fcnz fcnz fnhfntr naq fcnz!' abcdefghijklmnopqrstuvwxyz zabcdefghijklmnopqrstuvwxy DEFabc)
% for ((i=1;i<=5;i++))
for> do
for>     r=$(echo "${a[i]}"|q c.k "${b[i]}")
for>     s=$(echo "$r"|if [[ ${b[i]} == _* ]]; then q c.k "${b[i]/_}"; else q c.k "_${b[i]}"; fi)
for>     printf '%s\t%s\n' "$([[ ${c[i]} == $r ]] && echo good || echo bad)" "$([[ ${a[i]} == $s ]] && echo good || echo bad)"
for> done
good    good
good    good
good    good
good    good
good    good
%

Stax, 2 bytes
ç'

Run and debug it

There's really no point in packing the source code.

it gets me funny points

source: Stack Exchange

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/

sort: votes


text:
Create an interpreter for "Counter"
"Counter" is a language I've created for the purpose of this question.
Rules

Commands are read from left to right from the first character.
Each command may be executed as it is read, or you may execute all commands together at the end.
In case of an error, all commands up till the error must be executed.
A program is written in exactly one line.
Data is stored in counters. At the start, there is exactly one counter. More can be created and deleted.
A counter holds an integer value between -100 and 100 (limits inclusive).
Exactly one counter is the selected counter at any point in time.
Counters are arranged in a 1d array, so one can move left (previous) or right (next) to change selected counter.

Commands

Any number between -100 and 100 - Set the currently selected counter to that value.
c - Create a counter immediately after the currently selected counter, make it the selected counter, and set it to 0.
d - Delete the currently selected counter, and make the previous one selected. If it is the first one, this is an error.
+ - Make the next counter the selected one.
- - Make the previous counter the selected one. (Ensure that this command is not immediately followed by a number.)
o - Output the value in the selected counter, followed by a space.
? - If the value in the selected counter is 0, apply the d command on it.
# - If the value in the selected counter is 0, ignore the next command.
 (space) - No meaning, but is to be treated like a command, if preceded by a #. Used to demarcate numbers.

Errors

Going left of the leftmost counter, or right of the rightmost counter.
Deleting the first counter.
Encountering a # as the last command. (Of course, this means all commands will get executed anyways)
A command that does not exist.
A number that's too long.

Task
Create an interpreter in any language. Code will be in a file or given as input (your choice). Shortest code wins.
Lengthy example
Consider the code:
7cc--13 12do?+?#0#o3od-7o

Here is a breakdown of the program. [] indicates the selected counter.
Cmd   Memory    Output

7     [7]
c     7 [0]
c     7 0 [0]
-     7 [0] 0
-13   7 [-13] 0
      7 [-13] 0
12    7 [12] 0
d     [7] 0
o     [7] 0     7
?     [7] 0
+     7 [0]
?     [7]
#     [7]
0     [0]
#     [0]
o     [0]
3     [3]
o     [3]       3
d     This is an error. Program terminates here.

Total output 7 3

Oh, one thing you could still clarify is what exactly is allowed or required when an error is encountered. Clean termination of the program? Error message? Undefined behaviour as long as everything before the error works?

@Martin Any undefined behaviour as long as the previous commands have been executed and output is still visible.

When you say "deleting the first counter" is an error do you mean "deleting the only existing counter" or do you mean "deleting the first counter even if other ones exist and could become the selected counter"  For example: c-d

@Jerry The second case

Python3, 403 530 bytes
This is seriously golfable, but I can't think of how...
Thanks to @cat for 127 bytes!!! (I'm really bad at golfing in Python)
c=input()
a=[0]
s=0
i=0
def g(i,n):
 p=i
 if n:i+=1
 while c[i].isdigit():i+=1
 a[s]=int(c[p:i]);return i-1
def e():
 a.pop(s);s-=1
while i<len(c):
 d=c[i]
 if d.isdigit():i=g(i,0)
 elif d=='c':s+=1;a.insert(s,0)
 elif d=='d':e()
 elif d=='+':s+=1
 elif d=='-':
  if c[i+1].isdigit():i=g(i,1)
  else:s-=1
 elif d=='o':print(a[s],end=' ')
 elif d=='?':
  if a[s]==0:e()
 elif d=='#':
  if a[s]==0:i+=1
 i+=1

here's 406

JavaScript ES6, 300 bytes
Hey look, a nice round number!
x=>x.match(/-\d*|\d+|./g).map(c=>e?0:q?q--:c-101?Math.abs(c)>100?e++:s[p]=+c:c=="c"?s.splice(++p,0,0):c=="d"?s.length>1?s.splice(p--,1):e++:c=="o"?o+=s[p]+" ":c=="-"?--p<0&&e++:c=="+"?++p>=s.length&&e++:c=="?"?s[p]||(s.length>1?s.splice(p--,1):e++):c=="#"?s[p]||q++:c==" "?0:e++,s=[],e=p=q=0,o="")&&o

It doesn't error on # at the end of a program because that wouldn't affect anything at all. Let me know if I need to anyway.

JavaScript (ES6) 228
s=>s.replace(/-?(\d+)|./g,(t,n)=>i?++i:C[k]&&(u='?-+# odc'.indexOf(t),n<101?C[k]=t:u>6?C[S='splice'](++k,0,'0'):u>5?C[S](k--,1):u>4?o+=C[k]+' ':u>2?+C[k]?0:i=-(u<4):u>1?k++:u>0?k--:~u?+C[k]||C[S](k--,1):i=1),i=o='',C=[k='0'])&&o

Less golfed
s=>(
  i=o='',
  C=[k='0'], // C: counters, k: current counter index
  s.replace(/-?(\d+)|./g,
    (t,n)=>( // tokenize, n is eventually the number, unsigned
      i?++i:C[k] && ( // i>0 or C[k] undefined -> error found
      u='?-+# odc'.indexOf(t),
      n<101?C[k]=t // n present and < 101
      :u>6?C.splice(++k,0,'0') //c add counter
      :u>5?C.splice(k--,1) // d remove counter
      :u>4?o+=C[k]+' ' // o output
      :u>3?0 // space == NO OP
      :u>2?+C[k]?0:i=-1 // set i to -1 to skip the next command
      :u>1?k++
      :u>0?k--
      :~u?+C[k]||C.splice(k--,1) // ? conditional remove counter
      :i=1) // invalid command error
    )
  ),
  o // return output
)

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


text:
The Random Walker Printer
Draw a program or function that will write to STDOUT n times (each for one step) a string that contains a dot . at the location of the walker. The program also needs to write a line every s seconds (or wait s seconds after each line).
A random walk is a mathematical formalization of a path that consists of a succession of random steps (wiki), such that every new step will be the last step plus a new value, so any tstep value is just the sum of all the random values before ir plus the initial value.
The program should take 2 inputs and will use only spaces " " and dots "." on the output. The start value of the walker will be 20 such that the output should be a dot after 19 spaces.
                  . #19 spaces then a dot

Every new step the value will be the last value of the walker plus one of these[-2-1,0,1,2](20% chance each). After the new position is printed the program should wait s seconds and the go to the next step. If the step takes the walker outsite the range 1 to 40 it should be just ignored and the walker position stays the same. The number of spaces will always be a number from 0 to 39.
Example
#input
Mywalk(s = 0.1, n = 30)

#output
                     .
                    .
                      .
                        .
                          .
                           .
                            .
                          .
                         .
                          .
                           .
                            .
                           .
                          .
                           .
                           .
                         .
                         .
                          .
                            .
                           .
                          .
                           .
                           .
                           .
                         .
                          .
                         .
                          .
                          .

Considerations

You may take the input as any reasonable format
The shortest code wins
It's okay if your program only accept the seconds as integers

I assume n is the number of steps?

Yeah, I've clarified that, thanks.

I think you should say that the range is 1 to 40, because the number of spaces is always position-1.

@geokavel that seems better, fixed !

Draw a program??? ;-)

Pyth, 39
J19VEK+.d0QW<.d0K)+*d=JhtS[Z39-+O5J2)\.

Takes s as the first line of input and n as the second. Works on the command line but not with the online interpreter. My first Pyth program ever! Golfing tips are appreciated.

Welcome to Pyth! The only golfing  tip I can see is that you can use Q and E for the two inputs instead fo hQ and eQ, if you newline separate the inputs.

Matlab, 112
The core idea is generating a list of possible next positions and then uniformly drawing one of them. If we are e.g. at position $l=1$ the possible steps would be [-1,0,1,2,3] Of course if we would chose -1 that would be invalid and we would have to stay at the same position. Thats why we replace the invalid positions with the current position, [1,0,1,2,3], and then randomly chose an element from this updated list.
The OP asked us tho draw the program, so here we go:

The transcription:
function c(n,s);
l=19;                             %initialize position
for k=1:n;
    disp([ones(1,l)*32,'.']);     %print the line
    z=(-2:2)+l;                   %get vector of possible next steps (for l=1 we get [-1,0,1,2,3])
    z(z<0)=l;                     %prune invalids: here we just replace the the invalid positions with the current position
    z(z>39)=l;                    %   this ensures the same behaivour as staying in the same spot when going outside of the range
    l=z(randi(5));                %draw random sample of those
    pause(s);
end

-1 uses MathJax in a non-MathJax environment  ;)

O.o You know, equations that are not written in latex are just not quite as trustable, they might even be not true! Better be on the safe side.

Drawn programs should be measured in volume of ink, rather than bytes...

Perl, 136 128 116 106 101 90 86
$p=19;map{say$"x$p.".";sleep $ARGV[0];$x=rand(5)+$p-2;$p=$x>0&&$x<40?$x:$p}1..$ARGV[1]

Requires the seconds to be an integer.
Run with perl <filename> <second delay> <number of steps>.
There may be more golfing potential here, although honestly, I'm surprised it got this far. (Come on, only 6 more bytes to beat the bash answer...)
Changes

Saved 8 bytes by removing unneeded parentheses and spelling out ARGV (it's actually shorter that way)
Saved 12 more bytes by removing $s and $n and just using the plain $ARGV[0] and $ARGV[1]
Saved another 10 bytes when I realized I could use $" and didn't need to specifically define $u as $undef.
Saved 5 more bytes by rearranging the ternary and how $x is used and by using map instead of for.
Saved 11 bytes by no longer accepting the seconds as decimals (challenge spec says it's OK.)
Saved another 5 bytes by using say instead of print.

Python 2, 124 119 bytes
@janrn and @Steve Eckert: I don't have enough reputation to comment your answer but here's essentially your version shortened down. The task is to draw a program or a function, so by using f(s,x) you can save quite some bits, as well you can use max(0,min(x,39)) to avoid an extra if clause. Got it down to:
import time,random as r
def f(s,x):
 n=19
 while x:print' '*n+'.';time.sleep(s);n=max(0,min(n+r.randint(-2,2),39));x-=1

Bash, 81
for((s=20;i++<$1;t=s,s+=RANDOM%5-2,s=s<0|s>39?t:s)){
printf %${s}s.\\n
sleep $2
}

Edit: If the step takes the walker outsite the range 1 to 40 it should be just ignored and the walker position stays the same handled correctly.
Input from command-line options.  E.g.:
$ ./randwalk.sh 5 0.5
                    .
                     .
                    .
                  .
                 .
$

Processing, 150 147
void w(int n,int s){int x=20,i,y,c=0;for(;c<n;c++){x+=y=int(random(5)-2);if(x>40||x<0)x-=y;for(i=1;i<x;i++)print(" ");println(".");delay(s*1000);}}

Usage:
void setup() {
    w(10,1);
}

Note: 1000 can't be changed to 1e3 for type reasons.

Python 2.7, 198 162 143 133
import time,random as r;p=20;s=0;d=input();w=input()
while s<d:
 print' '*p+'.';s+=1;p=max(1,min(p+r.randint(-2,2),40));time.sleep(w)

When calling the script with python script.py, the first input is the amount of steps, second input the time between steps (accepts float or int). Any suggestions for improving?
Edits

saved 36 bytes due to now using print ' '*p+'.', thanks to @corsiKlause Ho Ho Ho
down another 19 bytes by removing tab indents, replaced them with one space or ; where possible
10 bytes less thanks to @Bruce_Forte idea with p=max(1,min(p+r.randint(-2,2),40)) (I can't comment on your answer as well, but thanks; don't want to copy it completely)

In Python, can't you just go ' '*p to repeat the string?

Actually yes, didn't know that. Editing now, thanks

Ruby, 84
def w(s,n)q=19;n.times{puts ' '*q+'.';sleep s;q+=rand(5)-2;q=[[q,0].max,39].min};end

Lua, 140 Bytes
Note: This program requires the LuaSocket package.
require"socket"p=19 for i=1,arg[2]+0 do print((" "):rep(p)..".")p=p+math.random(-2,2)p=p<0 and 0 or p>39 and 39 or p socket.sleep(arg[1])end

Perl 6, 92 bytes
my (\n,\s)=@*ARGS;$/=19;for (-2..2).roll(n) {put ' 'x($/+=(40>$/+$_>=0??$_!!0)),'.';sleep s} # 92

my (\n,\s)=@*ARGS;
$/=19;
for (-2..2).roll(n) {
  put ' 'x($/+=(40>$/+$_>=0??$_!!0)),'.';
  sleep s
}

Usage:
$ perl6 -e 'my (\n,\s)=@*ARGS;$/=19;for (-2..2).roll(n) {put " "x($/+=(40>$/+$_>=0??$_!!0)),".",;sleep s}' 10 0.001
                  .
                .
               .
              .
               .
                .
               .
                .
                  .
                 .

Mathematica, 122 117 bytes
$RecursionLimit=∞;If[#2>0,Print[Indent[a=Min[#3+RandomInteger@{-2,2},39]~Max~0],"."];Pause@#;#0[#,#2-1,a]]&[##,19]&

Recursive anonymous function, takes input in the order specified. Could probably be golfed further.

JavaScript (ES6), 125 bytes
(s,n)=>(t=setTimeout)(c=`console.log(" ".repeat(p)+".");p+=m=Math.random()*5|0;p-=p>41|p<2?m:2;--i&&t(c,d)`,d=s*1e3,p=19,i=n)

Explanation
(s,n)=>
  (t=setTimeout)(                     // set inital timeout
    c=`                               // c = code for timeout to execute
      console.log(" ".repeat(p)+"."); // print the current line
      p+=m=Math.random()*5|0;         // move walker 0 - 4 positions to the right
      p-=p>41|p<2?                    // if walker was moved out of bounds (2 - 41 instead
                                      //     of 0 - 39 because the random move of 0 - 4 to
                                      //     the right has not had the 2 subtracted yet)
        m:                            // undo the move
        2;                            // else subtract 2 to make the move -2 to 2
      --i&&t(c,d)                     // while we have steps remaining schedule next one
    `,
    d=s*1e3,                          // d = milliseconds to wait between steps
    p=19,                             // p = position of walker (0 indexed)
    i=n                               // i = steps remaining (needed to make n global)
  )

Test

console.log = s => result.textContent += s + "\n";
var solution = (s,n)=>(t=setTimeout)(c=`console.log(" ".repeat(p)+".");p+=m=Math.random()*5|0;p-=p>41|p<2?m:2;--i&&t(c,d)`,d=s*1e3,p=19,i=n)
<input type="number" id="seconds" value="0.1" />

<input type="number" id="steps" value="30" />

<button onclick="solution(+seconds.value,+steps.value)">Go</button>

k4, 61 characters
f:{y{-1((y:1|40&y+-2+*1?5)#" "),".";."\\sleep ",$x;y}[x]\20;}

sample run:
  f[.1]30
                      .
                    .
                    .
                   .
                   .
                  .
                  .
                   .
                   .
                     .
                    .
                  .
                  .
                    .
                   .
                   .
                 .
                .
               .
               .
              .
            .
          .
         .
         .
          .
            .
              .
              .
                .

Python 3, 154 bytes
import time
from random import*
w=int(input())
z=int(input())
g=19
c=6
s=" "
while c:
    c-=1
    s+=s
while z:
    z-=1
    if -1<g<40:
        print(s[:g]+'.')
    time.sleep(w)
    g+=randint(-2,2)

Generate a string of spaces greater than the maximum required length, then print that string ONLY up to the char at index 'g', then print a '.'. Finish by incrementing g by a random value in the range [-2:2], and repeat.
If anyone could help me golf down that horrific input block, I'd appreciate it.

To golf the input, why not use sys.argv?

Also, instead of while z:, why not use for i in range(1,z)?

I'm curious, how did you get that this is 154 bytes? http://bytesizematters.com/ gives a different count (even if you disable counting whitespace)

@ASCIIThenANSI: Hmm...by the time I add in the initial call to sys.argv and the import, I can't see how I can save any bytes doing that. And even with the extra lines to declare c then decrement c and z, it's still cheaper to do it this way, by my count.

@p1xel: I counted whitespaces internal to the line, just not leading or trailing whitespaces. Is there a different scoring standard that I'm unaware of?

@SteveEckert What exactly does c do?

@ASCIIThenANSI c is regulating length when I'm generating my string of spaces s that I'm outputting a substring of prior to the .. It could be pretty much anything that won't make the string longer than whatever python's max string length is, but I haven't yet figured out how to do that using existing variables without increasing byte count.

@SteveEckert I'm pretty sure most people also count newlines: this is why you see golfed solutions compressed onto one line. Someone can correct me if I'm wrong.

Whitespace counts, just an any other character. Assuming those 4 leading spaces are actually tabs, your code appears to be 177 bytes long.

C funtion, 114
s=20,i,t;w(int n,float f){for(;i++<n;t=s,s+=rand()%5-2,s=s<0||s>39?t:s,usleep((int)(f*1e6)))printf("%*c.\n",s,0);}

Pretty much a direct translation of my bash answer.
Full test program:
s=20,i,t;w(int n,float f){for(;i++<n;t=s,s+=rand()%5-2,s=s<0||s>39?t:s,usleep((int)(f*1e6)))printf("%*c.\n",s,0);}

int main (int argc, char **argv) {
  w(10, 0.2);
  return 0;
}

APL (Dyalog Unicode), 35 bytes
⍬⊣⎕{⎕←⌽⍵↑'.'⋄1⌈40⌊⍵+3-?5⊣⎕DL⍺}⍣⎕⊢20

Try it online!
A full program which takes n as first input and s as the second.
⍬⊣⎕{⎕←⌽⍵↑'.'⋄1⌈40⌊⍵+3-?5⊣⎕DL⍺}⍣⎕⊢20
   {                         }⍣⎕    do the following n times
  ⎕                                 with s as constant left argument ⍺
                                ⊢20 and 20 as right argument ⍵
       ⍵↑'.'                        take ⍵ characters from '.'
      ⌽                             reverse to pad with spaces
    ⎕←                              and display it
                         ⎕DL⍺       delay s seconds
                        ⊣           suppress it's return value with
                      ?5            a random number in 1-5
                    3-              subtract from 3 to get negative possibilities
                  ⍵+                add current ⍵ to it
               40⌊                  minimum of that and 40
             1⌈                     maximum of that and 1
⍬⊣                                  suppress the final return value.


text:
Run-Length Racers
You will be given two pieces of input: a string in run-length encoded format defining the running track, and a capital letter representing the lane to start from. For example, the string "3a4A6b5B" expands to "aaaAAAAbbbbbbBBBBB". You then use the expanded string to create a track, as such:
 A) aaaAAAA
 B) bbbbbbBBBBB

This is a track with two lanes. Lowercase letters represent air. You can not run on air! Uppercase letters represent road you can run on. Your goal for this challenge is, given a capital letter, output how far a racer starting on that lane could run. Racers are allowed to switch lanes if there is a piece of road directly above or below them. They are also allowed to run backwards! On this particular track the output is 0 for any letter input, because neither of the tracks has runnable road at position 1.
Examples:
Input: "4A5B4c3C", "A"
This code expands to a track that looks like this:
A) AAAA
B) BBBBB
C) ccccCCC

The output for this example is 7, because a runner starting on lane A could move down to lane B, and then lane C, and end up at the 7th position.
Input: "4A2B3D", "D"
Track:
A) AAAA
B) BB
C)
D) DDD

The output is 3, because a runner starting on lane D has no way to get to lane B or A
Input: "4A4a4A3b6B5C", "A"
Track:
A) AAAAaaaaAAAA
B) bbbBBBBBB
C) CCCCC

The output is 12, because the runner on A can switch over to B, and then come back to A at the end. The max distance for "C" is also 12. For "B" it is 0.
Input: "12M4n10N11O", "M"
Track:
M) MMMMMMMMMMMM
N) nnnnNNNNNNNNNN
O) OOOOOOOOOOO

Simple example with multi-digit run-lengths. Output is 14.
Input: "4A5B1b2B4c3C", "A"
Track:
A) AAAA
B) BBBBBbBB
C) ccccCCC

The output is 8, because the runner at A can go down to B, then down to C, then come back to B. (Thank you to FryAmTheEggman for this example.)
Input: "1a2A2a2B1c1C1d3D", "B"
Track:
A)aAAaa
B)BB
C)cC
D)dDDD

Output is 4. Runner has to check both paths two see which goes further. (Thanks to user81655 for this example.)
Input: "2A1b1B2C1D3E","A"
Track:
A) AA
B) bB
C) CC
D) D
E) EEE

Output is 3. You have to run backwards to reach the furthest destination. (Once again, thanks to user81655 for this example.)
Notes:

If a track does not have a letter at a certain position, that counts as air too. As such, if the input is "Q" and no road has been placed on lane "Q" the output should be 0.
There are two pieces of input. The first is a run-length encoded string. The second is a capital letter (you can use string or char datatype for this.)
For readability, there should be some reasonable separator between these inputs (space, new line, tab, comma, semi-colon).
The run-length encoded string will always list elements in alphabetical order
The very longest the entire length of a lane can be is 1000. Therefore, the greatest possible output is 1000.

Track Generator:
In honor of our first answer, here is a track generator. Try to come up with something to stump the current answers! (Note: Just because the generator doesn't show an error message doesn't mean your track code is necessarily valid. See above examples for proper form.)

function reset() {
    var t = document.getElementById("track");
    t.innerHTML = "";
    for(var i = 0;i<26;i++) {
      var c = String.fromCharCode(i+65);
      t.innerHTML += "
"+c+")
";

    }
  }

function rand() {
  var track = "";
  for(var i = 0;i<26;i++) {
  var blocks = Math.floor(Math.random()*4);
  var start = Math.floor(Math.random()*2);
  for(var j = 0;j<blocks;j++) {
    var letter = String.fromCharCode(65+i+32*((start+j)%2));
    var length = Math.floor(Math.random()*4)+1;
    track += length+letter;
  }
  }
  document.getElementById("code").value = track;
}

  function gen() {
  var s = document.getElementById("code").value;
    var check = s.match(/(\d+[A-Za-z])+/);
    if(check == null || check[0]!=s) {
      alert("Invalid Track");
      return false;
    }
    reset();
  var n = s.match(/\d+/g);
    var o = s.match(/[A-Za-z]/g);
    for(var i = 0;i<n.length;i++) {
      var c = o[i].toUpperCase();
      document.getElementById(c).textContent += o[i].repeat(n[i]);
    }
    return true;
    }

Track: <input type="text" id="code" size="75%" /><input type="submit" onclick="gen()" /><input type="button" value="Random Track" onclick="rand()" />

With the switch decisions and the backwards running it's more of a maze than a track now :P

Is there only ever one route - as in the test cases?

@RichieAHB There could be more than one route.

Just wondering if maybe the complication of handling the missing C in 4A2B3D could be removed? For instance, adding 0c? If not, is it expected when say 1A1Z were given, lanes B-Y are assumed to exist (but are empty)?

Also, the backwards running is a huge problem. The 12M4n10N11O example, output 14, is then false: the longest path starts at M0 and ends at C0, for a length of 25.

@Kenney  Its not distance traveled,  it's how far you go horizontally. Yes, all lanes always exist, but by default are empty.

Perl, 231 219 203 192 189 bytes
includes +1 for -p

sub f{my($l,$p,$m)=@_;map{$m=$_>$m?$_:$m}f($l,$p+1)+1,f($l-1,$p),f($l+1,$p),f($l,$p-1)-1if$L[$l][$p]&&!$V{$l}{$p}++;$m}s/(\d+)(.)\s*/push@{$L[ord$2&~32]},(0|$2lt'a')x$1;()/ge;$_=0|f(ord,0)

Less golfed:
sub f{                          # this is a recursive function, so we need locals.
    my($l,$p,$m)=@_;            # in: lane, position; local: max path length

    map{
      $m = $_ > $m ? $_ : $m    # update max
    }
    f( $l,   $p+1 )+1,          # same lane, forward
    f( $l-1, $p   ),            # left lane, same pos
    f( $l+1, $p   ),            # right lane, same pos
    f( $l,   $p-1 )-1           # same lane, backtrack
    if
        $L[$l][$p]              # check if there's road here
    && !$V{$l}{$p}++            # and we've not visited this point before.
    ;

    $m                          # return the max
}

s/(\d+)(.)\s*/                  # Parse RLE pattern, strip starting lane separator
  push@{ $L[ord$2&~32] }        # index @L using uppercase ascii-code, access as arrayref
  ,(0|$2lt'a')x$1               # unpack RLE as bitstring
  ;()                           # return empty list for replacement
/gex;                           # (x for ungolfing)
                                # $_ now contains trailing data: the start lane.

$_ =                            # assign output for -p
   0|                           # make sure we print 0 instead of undef/nothing
   f(ord,0)                     # begin calculation at start of current lane

Running
Store the code above in a file (say 231.pl). Input in the form of (\d+\w)+ *\w. Example: inputting track 4A5B4c3C and lane A:
echo 4A5B4c3C A | perl -p 231.pl

TestSuite
(not golfed)
printf "==== Testing %s\n", $file = shift // '231.pl';

sub t{
    my($input,$expect) = @_;
#   $input =~ s/\s//g;
    printf "TEST %-20s -> %-3s: ", $input, $expect;

    $output = `echo $input | perl -p $file`;

    printf "%-3s  %s\n", $output,
    $output == $expect
    ? " PASS"
    : " FAIL: $output != $expect";

}

t("4A5B4c3C A", 7);
t("4A5B4c3C C", 0);
t("4A2B3D D", 3);
t("4A4a4A3b6B5C A", 12);
t("4A4a4A3b6B5C B",  0);
t("4A4a4A3b6B5C C", 12);
t("12M4n10N11O M", 14 );
t("4A5B1b2B4c3C A", 8);
t("1a2A2a2B1c1C1d3D B", 4 );
t("2A1b1B2C1D3E A", 3 );
t("10A9b1B8c2C9D1E11F A", 11);

update 219 save 12 bytes by reworking array indices.
update 203 Save 16 bytes by refactoring recursion.
update 192 save 11 bytes by eliminating the @L=map{[/./g]}@L postprocessing.
update 189 save 3 bytes by postfixing if using map instead of for.

I don't if this is a Perl thing, but this runs FAST.

JavaScript (ES6), 298 334 bytes
(t,s)=>[a=[],t.match(/\d+(.)(\d+\1)*/gi).map(l=>a[c=l.match`[A-Z]`+"",n=c.charCodeAt(),c==s?i=n:n]=l[r="replace"](/\d+./g,p=>(p.slice(-1)<"a"?"1":"0").repeat(parseInt(p))),i=o=-1),...a.join``,a[i]?a[i]=a[i][r](/^1/,2):0].map(_=>a.map((l,y)=>a[y]=l[r](/1/g,(c,x)=>((a[y-1]||s)[x]|(a[y+1]||s)[x]|l[x-1]|l[x+1])>1?(x>o?o=x:0,2):c)))&&o+1

Explanation
Basically this solution treats the track as a maze. It finds where all the tiles that are possible for the runner to reach are and returns the greatest value of the X index it found.
The first thing it does is decode the input string into an array of lines. Instead of using letters though, it turns a capital letter into a 1 and a lowercase letter into a 0. The resulting map will look something like this:
11100011
0011100
100111

After this it makes the first tile of the starting track a 2 (only if it is already 1) and loops through every tile checking adjacent tiles for a 2. If a 1 has an adjacent 2 it becomes a 2. The above map will become this if the runner started on the first line:
22200011
0022200
100222

The highest X index for a 2 becomes the result.
I made a very minor oversight when I did the initial version of this and it cost me 36 bytes to hack at it until it worked, so there's probably a lot of improvements that could be made to this. *sigh*
Ungolfed
(t,s)=>
  [

    // Decode run-length encoded string into an array of track lanes
    a=[],                           // a = array of track line strings, 0 = air, 1 = tiles
    t.match(/\d+(.)(\d+\1)*/gi)     // regex magic that separates pairs by their letter
    .map(l=>                        // for each line of pairs
      a[                            // add the tiles to the array
        c=l.match`[A-Z]`+"",        // c = pair character
        n=c.charCodeAt(),           // n = index of line
        c==s?i=n:n                  // if this line is the starting line, set i
      ]=l[r="replace"](/\d+./g,p=>  // match each pair, p = pair
        (p.slice(-1)<"a"
          ?"1":"0").repeat(         // repeat 0 for air or 1 for ground
            parseInt(p)             // cast of match would return NaN because of the
          )                         //     letter at the end but parseInt works fine
      ),
        i=                          // i = index of starting line, initialise as invalid
          o=-1                      // o = output (max value of x)
    ),

  // Find all positions that are possible for the runner to get to
    ...a.join``,                   // add every letter of the track lines to an array
    a[i]?a[i]=a[i][r](/^1/,2):0    // set the starting tile to 2 if it is already 1
  ].map(_=>                        // loop for the amount of tiles, this is usually way
                                   //     more than necessary but allows for hard to reach
                                   //     tiles to be parsed
    a.map((l,y)=>                  // for each line l at index y
      a[y]=l[r](/1/g,(c,x)=>       // for each character c at index x

        // Replace a 1 with 2 if there is a 2 to above, below, left or right of it
        ((a[y-1]||s)[x]|(a[y+1]||s)[x]|l[x-1]|l[x+1])>1?
          (x>o?o=x:0,2):c          // set o to max value of x for a 2 tile
      )
    )
  )
  &&o+1                            // return o + 1

Test
Bonus: Output includes the parsed map!

var solution = (t,s)=>[a=[],t.match(/\d+(.)(\d+\1)*/gi).map(l=>a[c=l.match`[A-Z]`+"",n=c.charCodeAt(),c==s?i=n:n]=l[r="replace"](/\d+./g,p=>(p.slice(-1)<"a"?"1":"0").repeat(parseInt(p))),i=o=-1),...a.join``,a[i]?a[i]=a[i][r](/^1/,2):0].map(_=>a.map((l,y)=>a[y]=l[r](/1/g,(c,x)=>((a[y-1]||s)[x]|(a[y+1]||s)[x]|l[x-1]|l[x+1])>1?(x>o?o=x:0,2):c)))&&o+1
function generateMap() { var start = 0; a.some((l, i) => l ? start = i : 0); var end = 0; a.map((l, i) => l && i <= 90 ? end = i : 0); for(var output = "", i = start; i < end + 1; i++) output += String.fromCharCode(i) + ") " + (a[i] || "") + "\n"; return output; }
Track = <input type="text" id="track" value="2A1b1B2C1D3E" />

Starting Letter = <input type="text" id="start" value="A" />

<button onclick="result.textContent=solution(track.value,start.value)+'\n\n'+generateMap()">Go</button>


text:
Sums of prime factors
2013 has the prime factorization 3*11*61. 2014 has the prime factorization 2*19*53. An interesting property regarding these factorizations is that there exist distinct primes in the factorizations of 2013 and 2014 that sum to the same number: 11+61=19+53=72.
Write a program or function that takes as its input two positive integers greater than 1 and returns a truthy value if there exist a sum of selected prime factors of one number that is equal to a sum of selected prime factors in the second number, and a falsey value otherwise.

Clarifications

More than two prime factors can be used. Not all of the prime factors of the number need to be used in the sum. It is not necessary for the number of primes used from the two numbers to be equal.
Even if a prime is raised to some power greater than 1 in the factorization of a number, it can only be used once in the sum of primes for the number.
1 is not prime.
Both input numbers will be less than 2^32-1.

Test cases
5,6
    5=5
    6=2*3
    5=2+3
==>True

2013,2014
    2013=3*11*61
    2014=2*19*53
    11+61=19+53
==>True

8,15
    8=2^3
    15=3*5
    No possible sum
==>False

21,25
    21=3*7
    25=5^2
    No possible sum (can't do 3+7=5+5 because of exponent)
==>False

This is code golf. Standard rules apply. Shortest code in bytes wins.

I like challenges like this, but for golfing languages, it will be a chain of built-ins: factor, uniquify, subsets, sums, overlap.

Can we take input as a two-item array?

@ETHproductions By default, yes.

What about 14 (27) and 21 (37), is that true, as they share the factor 7 ?

@SimonForsbergMcFeely Yes

Julia, 95 93 bytes
g(x)=reduce(vcat,map(p->map(sum,p),partitions([keys(factor(x))...])))
f(a,b)=g(a)∩g(b)!=[]

The primary function is f and it calls a helper function g.
Ungolfed:
function g(x::Integer)
    # Find the sum of each combination of prime factors of the input
    return reduce(vcat, map(p -> map(sum, p), partitions([keys(factor(x))...])))
end

function f(a::Integer, b::Integer)
    # Determine whether there's a nonzero intersection of the factor
    # sums of a and b
    return !isempty(g(a) ∩ g(b))
end

Saved 2 bytes thanks to Darth Alephalpha

I noticed this was downvoted. Is there anything I've overlooked? If it's wrong I'd be happy to fix it, but as it stands it works fine for me and passes all test cases.

I think map(p->map is shorter than (m=map)(p->m.

@DarthAlephalpha Good call, thanks.

Pyth - 17 12 11 bytes
Thanks to @FryAmTheEggman for fixing my answer and saving a byte.
@FmsMty{PdQ

Test Suite.

I think using ty works and saves a bye?

@FryAmTheEggman thanks!

@Maltysen you missed a golden opportunity to say "ty"

Pyth, 11 bytes
t@FmsMy{PdQ

Input in the form 30,7.
t@FmsMy{PdQ     implicit: Q=input tuple
      y         powerset of
       {        unique elements of
        Pd      prime factorizations of d
    sM          Map sum over each element of the powerset
    sMy{Pd      lambda d: all sums of unique prime factors of d
   m      Q     Map over Q. Produces a two-element list.
 @F             Fold list intersection
t               Remove first element, which is a 0.
                If no other common sums, the remaining empty list is falsy.

This is now identical to the other Pyth answer, with the exception of one moved letter ;)

@ETHproductions I answered before Maltysen fixed theirs; so I'll keep it.

Haskell, 115 106 bytes
import Data.Numbers.Primes
import Data.List
p=map sum.tail.subsequences.nub.primeFactors
a#b=p a/=p a\\p b

Usage example: 2013 # 2014 -> True.
p makes a list of all prime factors of it's argument, removes duplicates, makes a list of all subsequences, drops the first one (which is always the empty list) and finally sums the subsequences. # checks whether p a is not equal to the difference p a \\ p b. If not equal, they have at least one common element.

CJam, 23 bytes
q~{mf_&0a\{1$f++}/}/&0-

Test it here.
The truthy value will be all common sums concatenated, the falsy value is the empty string.
Explanation
q~     e# Read and evaluate input.
{      e# For each of the two numbers...
  mf   e# Get the prime factors.
  _&   e# Remove duplicates.
  0a\  e# Put an array containing a 0 below to initialise the list of possible sums.
  {    e# For each prime factor...
    1$ e#   Make a copy of the available sums so far.
    f+ e#   Add the current factor to each of them.
    +  e#   Combine with the list of sums without that factor.
  }/
}/
&      e# Set intersection between the two lists of sums.
0-     e# Remove the 0 which is always in the intersection.

Japt, 25 bytes
[UV]=N®k â à mx};Ud@J<VbX

Outputs true or false. Try it online!
Ungolfed and explanation
[UV]=N®   k â à mx};Ud@ J<VbX
[UV]=NmZ{Zk â à mx};UdX{J<VbX

          // Implicit: N = list of inputs
[UV]=N    // Set variables U and V to the first to items in N,
mZ{    }  // with each item Z mapped to:
Zk        //  Generate list of Z's factors.
â         //  Keep only the unique items.
à         //  Generate all combinations.
mx        //  Sum each combination.
UdX{      // Check if any item X in U fulfills this condition:
J<VbX     //  -1 is less than V.indexOf(X).
          // Implicit: output last expression

For an extra byte, you can split up the factorize-unique-combine-sum code between both inputs, with the added advantage of having a time complexity of O(O(25-byte version)^2):
Uk â à mx d@J<Vk â à mx bX

Brachylog, 10 9 bytes
{ḋd⊇+ℕ₁}ᵛ

Try it online!
The predicate succeeds returning [the sum, the sum] if it exists, and fails if the sum does not exist.
{            Start of inline predicate.
 ḋ           The prime factors of the input,
  d          with duplicates removed.
   ⊇         Some subset of the unique prime factors
    +ℕ₁      has a sum greater than 0 which is output.
       }ᵛ    The predicate can have the same output for both elements of the input.

-1 byte thanks to Fatalize (the creator of Brachylog) reminding me that the verify meta-predicate exists.

You can use ᵛ - verify instead of ˢ= to save one byte.

MATL, 23 bytes
2:"iYfutn2w^1-:B!Y*]!=z

Uses current release, 2.0.2, which is earlier than this challenge.
The numbers are provided as two separate inputs. Output is 0 or 1.
Example
>> matl 2:"iYfutn2w^1-:B!Y*]!=z
> 2013
> 2014
1

Explanation
2:           % vector of two numbers, to generate two iterations
"            % for loop
  i          % input number
  Yfu        % get prime factors without repetitions
  tn         % duplicate and get number of elements in array N
  2w^1-:     % numbers from 1 to 2^N
  B!Y*       % convert to binary, transpose and matrix multiply to produce all sums
]            % end
!=z          % true if any value is equal to any other

Mathematica, 58 bytes
Tr/@Rest@Subsets[#&@@@FactorInteger@#]&/@IntersectingQ@##&

Explanation:
This is an anonymous function.
First, IntersectingQ checks if two lists are intersecting. But the inputs are numbers instead of lists, so it remains unevaluated. For example, if the inputs are 2013 and 2014, then IntersectingQ@##& returns IntersectingQ[2013, 2014].
Tr/@Rest@Subsets[#&@@@FactorInteger@#]& is another anonymous function that takes an integer, gets a list of its prime factors without repetitions, takes the power set, removes the empty set, and then takes the sum of each set. So Tr/@Rest@Subsets[#&@@@FactorInteger@#]&[2013] returns {3, 11, 61, 14, 64, 72, 75}.
Then map Tr/@Rest@Subsets[#&@@@FactorInteger@#]& over the expression IntersectingQ[2013, 2014].  Tr/@Rest@Subsets[#&@@@FactorInteger@#]&[2013] and Tr/@Rest@Subsets[#&@@@FactorInteger@#]&[2014]] are lists, so we can get the collect result this time.

Calling IntersectingQ first is amazing! :)

Could you add an explanation?

PARI/GP, 98 bytes
Factor, grab primes ([,1]), loop over nonempty subsets, sum, and uniq, then intersect the result of this for the two numbers. The returned value is the number of intersections, which is truthy unless they are 0.
f(n,v=factor(n)[,1])=Set(vector(2^#v-1,i,vecsum(vecextract(v,i))))
g(m,n)=#setintersect(f(m),f(n))

APL (Dyalog Extended), 23 17 bytesSBCS
-5 thanks to ngn
Anonymous tacit infix function.
1<≢⍤∩⍥(∊0+⍀.,∪⍤⍭)

Try it online!
⍥{…} apply the following anonymous function to both arguments:
 ⍭ prime factors
 ⍤ then
 ∪ the unique ones of those
 0+⍀., addition table reduction of zero concatenated to each factor
 ∊ ϵnlist (flatten)
∩ the intersection
⍤ then
≢ the tally of those
1< is there more than one? (one because the sums of no factors)

using only features from dyalog proper: p+.×⊤1↓⍳2*≢p← -> 1↓∊(⊢,+)/0,⍨

even shorter: 1↓∊∘.+/0,¨

which is 1↓∊0∘.+., an inouter product - how often do you see that :)

if i understand ⍥ correctly, this should work too: 1<∘≢∩⍥{∊0∘.+.,∪⍭⍵}

@ngn Thanks. Done.

05AB1E, 10 8 bytes
f€æO`å¦à

-2 bytes thanks to @Emigna.
Try it online or verify all test cases.
Explanation:
f         # Get all distinct prime factors of both values in the (implicit) input-list
          #  i.e. [2013,2014] → [[3,11,61],[2,19,53]]
 €æ       # Get the powerset for each
          #  → [[[],[3],[11],[3,11],[61],[3,61],[11,61],[3,11,61]],
          #     [[],[2],[19],[2,19],[53],[2,53],[19,53],[2,19,53]]]
   O      # Sum each inner-most list
          #  → [[0,3,11,14,61,64,72,75],[0,2,19,21,53,55,72,74]]
    `     # Push both lists to the stack
     å    # Check for each value in the second list if it's present in the first list
          #  → [1,0,0,0,0,0,1,0]
      ¦   # Remove the first item (since the powerset included empty leading lists)
          #  → [0,0,0,0,0,1,0]
       à  # Check if any are truthy by taking the maximum (which is output implicitly)
          #  → 1

f€æO\å¦à` should work for 8.

Japt, 12 bytes
®k â à mx
rø

Run it online

Python 3, 206 bytes
This is a lambda function (m), which takes in 2 numbers and returns a set containing any sums of prime factors that they have in common. In Python this is a truthy value when non-empty, and a falsey value when empty.
Edit: Turns out my original answer didn't work for prime inputs, as pointed out by @JoKing. This has been fixed (along with some other bugs) at the tragic cost of 40 bytes.
q=__import__('itertools').permutations
def p(n):
 i,s=2,set()
 while~-n:
  if n%i:i+=1
  else:n//=i;s|={i}
 return s
s=lambda f:{sum(i)for l in range(1,len(f)+1)for i in q(f,l)}
m=lambda a,b:s(p(a))&s(p(b))

Quick explanation using comments:
#Alias for permutations function
q=__import__('itertools').permutations
#Returns set of prime factors of n, including n, if prime
def p(n):
 i,s=2,set()
 while~-n:
  if n%i:i+=1
  else:n//=i;s|={i}
 return s
#Returns all possible sums of 2 or more elements in the given set
s=lambda f:{sum(i)for l in range(1,len(f)+1)for i in q(f,l)}
#Returns any shared possible sums of prime factors of a and b (the intersection of the sets)
m=lambda a,b:s(p(a))&s(p(b))

Try it online!

This doesn't work for the first test case 5,6, since it doesn't handle prime inputs

@JoKing Thanks for catching that. Answer has been updated.

APL(NARS), 50 char, 100 bytes
{⍬≢↑∩/+/¨¨{⍵∼⊂⍬}¨{0=⍴⍵:⊂⍬⋄s,(⊂1⌷⍵),¨s←∇1↓⍵}¨∪¨π¨⍵}

here π would find the array of factors on its argument;
{0=⍴⍵:⊂⍬⋄s,(⊂1⌷⍵),¨s←∇1↓⍵}

would be the
function that find all subsets... i have to say that it seems {⍵operator itsArguments}¨ (for each left)
and ¨ (for each right) can imitate loop with fixed number of cycles and ¨¨ is ok in to see
subsets of one set... this way of see it seems reduce symbols in describe loops...; test
  h←{⍬≢↑∩/+/¨¨{⍵∼⊂⍬}¨{0=⍴⍵:⊂⍬⋄s,(⊂1⌷⍵),¨s←∇1↓⍵}¨∪¨π¨⍵}
  h 5 6
1
  h 2013 2014
1
  h 8 15
0
  h 21 25
0

One little analysis:
π¨⍵  for each arg apply factor
∪¨ for each arg apply unique
{0=⍴⍵:⊂⍬⋄s,(⊂1⌷⍵),¨s←∇1↓⍵}¨ for each arg apply subsets
{⍵∼⊂⍬}¨ for each argument subtract Zilde enclosed (that would be the void set)
+/¨¨ for each arg (for each arg apply +/)
⍬≢↑∩/ apply intersection, get the first argument and see if it is Zilde (this it is right because enclosed Zilde it seems is the void set)

Japt -¡, 14 bytes
®k â ã mx
rf Ê

Saved 3 bytes thanks to @Shaggy
Try it

The second line can be ÎfUÌ l or, shorter still, rf l. rø would be the shortest way of doing that, but Oliver beat you to it.

Gaia, 16 11 bytes
ḍzΣ¦
↑@↑&ỵ!

Try it online!
The top function (first line) calculates the sums of the powerset of prime factors, and the second function finds if any of the elements of the intersection are nonzero.


text:
Map a random number to pi
A double precision representation of a decimal can only guarantee an accuracy of 15 decimal places, thus pi is approximated as:
3.141592653589793

You can see that the digit 3 is in positions 1, 10, 16, the digit 1 is in positions 2, 4 etc.
Challenge
Your task is to create a program or function that creates a random double number between 0 and 1, and maps the values of that number onto the value of pi. You do this by placing the different digits in the random numbers in the position that digit has in pi. If the digit is not found in pi, you'll skip it, and every digit in pi that's not in the random number will be represented by an x. Each value can only be used once, starting from the left.
A few examples will probably make this more clear. In the following examples, the first number is pi, the second is the random number, and the last is the desired output.
3.141592653589793
0.111111111111111
x.1x1xxxxxxxxxxxx

3.141592653589793
0.531000000000000
3.1xx5xxxxxxxxxxx

3.141592653589793
0.123456789123456
3.141592653x8x7xx

3.141592653589793
0.967552381459391
3.14159265358979x

Rules:

The function should not take any input (a possible exception is explained in bullet point 3)
The output shall consist of only the output string, with an optional newline (a single trailing space is also accepted)
If your program doesn't have a built-in Pi-value, and/or a RNG then you can hardcode Pi, and take the random number as input. You cannot hardcode the random number or take Pi as input.
Both the hardcoded value for Pi, and the 15 random digits (you can skip 0. since you know it will be between 0 and 1), will be included in the byte count.
If your language doesn't have the required precision, you can use less precision under the following restrictions

The digits of Pi must be accurate up to the precision you have
You can't output more values than you're guaranteed to have correct, i.e. you can't output 15 digits if the precision only allows 8 accurate decimals.
The hardcoded value of Pi will count as 16 bytes (you don't need the decimal point), even if your program only supports 8 digits.
The input value for the random number will count as 15 bytes (you don't need 0.. This is because languages with low precision should not have an unfair advantage.
The program must support 5 decimals precision (at least).
Edit: To validate the answer: The random number should be printed somehow, but this operation doesn't have to be included in the byte count. So for instance, if it's possible to insert a print r in the end of the script, that part will not increase the score.
You cannot subtract the bytes if it's part of another necessary operation. I.e. if the code is print pi, r, then you can only subtract , r.
If you have to insert parts several places in the code, please include both versions (the one that prints the random number and the one that doesn't with a comment such as: _p and _oNo are needed to print the random number. _p does xxx and _oNo does yyy. _p and _oNo will not be included in the byte count.

Shortest code in bytes win.

Leaderboard
The Stack Snippet at the bottom of this post generates the catalog from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
## Language Name, N bytes

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

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

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

If you are using a built-in random number, does it have to contain 15 digits or can it have more? Also are there any requirements to output the random number? If not it makes it a bit harder to validate answers.

Aah, that's a good point! The random number can have more than 15 digits. I'll make an edit explaining what to do with the random number. Thanks for commenting!

Does random "between 0 and 1" mean 0 < random < 1 or 0 <= random <= 1?

@StewieGriffin I'm confused. Does this mean we can use 15 digits of pi and a 16/17-digit random number?

@Jakube, to be honest: I read the question a bit wrong, thus answered that it could have more digits, so the answer to your question is yes. It's too late to go back on that answer now since most answers have not capped the number of random digits. Please restrict it to 17 though.

@ChrisDegnen, the likelihood of hitting exactly 0 or 1 for a random double is negligible, so 0 <= random <= 1 is fine.

Pyth, 25 bytes
 u&p?}HGH\x.-GH`.n0<`O017

Try it online: Demonstration or Test showing the random number
Explanation:
 u&p?}HGH\x.-GH`.n0<`O017
                .n0         the constant pi
               `            convert it into a string
                     O0     random number in the range [0.0, 1.0)
                    `       convert to string
                   <   17   only use the first 17 chars (zero, point and 15 digits)
 u                          for each char H in the pi-string:
    ?}HGH\x                    if H in G (the random number string) then H else "x"
   p                           print this char without newline
  &                            and
           .-GH                remove the digit H once from G
<space>                     suppress the output (u returns the unused digits in G)

LabVIEW, 53 LabVIEW Primitives
I match Strings and put the number into an "empty" x.xxx string and remove the number from pi so it doesn´t show up again.
the random number and the single chars here are kinda visible, is that all right or do i have to redo the recording?

It's quite clearly doing the job even if a few chars are a bit hard to see, so you don't have to redo anything... Nice answer! =)

Mathematica, 105 or 147 characters
If random number "between 0 and 1" means 0 <= random <= 1, i.e. includes 0 & 1.
StringReplace[ToString@InputForm@N@Pi,
Thread[ToString/@Complement[Range@9,RandomInteger[{0,9},15]]->"x"]]

(105 characters)
Otherwise, taking random number "between 0 and 1" to mean 0 < random < 1.
Loop to get 15 random integers, not all zero.  Select complement from 0 to 9 range, i.e. those numbers from 0 to 9 not in the random list.  Convert those integers to strings and replace the matching characters in a pi string.
(147 characters)
While[True,r=RandomInteger[{0,9},15];
If[Union@r!={0},Break[]]];
StringReplace[ToString@InputForm@N@Pi,
Thread[ToString/@Complement[Range@9,r]->"x"]]

3.1x15x265358x7x3

Random digits:-
FromDigits[r]

820307536180783

Please include the version of the code you have actually counted.

Done. Line breaks only included for readability.

Still comes out as 149 bytes for me (with linebreaks, 146 without). There's nothing wrong with adding both a golfed and an ungolfed version. Some golfing tips: True is 1>0, RandomInteger can use infix notation {0,9}~RandomInteger~15. You can probably save some bytes by giving r some value and actually using the condition of the While instead of using Break. Then For might save another byte over While. Although I don't see why you need the loop at all if you instead assume the random number in range [0,1).

@MartinBüttner I like 1>0 :-)

I would usually read random number "between 0 and 1" to mean 0 < random < 1.

I think most languages will give you 0 ≤ r < 1 because then only the fractional part is random, because the integer part is fixed, and any fractional part is possible.

@MartinBüttner Theoretically, an RNG providing infinitely precise real numbers should have a 0% chance of producing 0 or 1 anyway. However, floating-point precision invalidates this.

The likelihood of hitting exactly 0 or 1 for a random double is negligible, so in this challenge 0 <= random <= 1 is fine.

JavaScript (ES6), 89 87 bytes
_=>(r=[...Math.random()+""],Math.PI+"").replace(/./g,d=>(r[i=r.indexOf(d)]=_,~i?d:"x"))

Explanation
Edit: Random string is now not truncated as clarified by the poster.
Loops through each digit of pi and removes the digit from the random number if it was found, else replaces the digit in pi with x.
_=>(
    r=[...Math.random()+""],      // r = array of 15 digit random number chars
    Math.PI+"").replace(/./g,d=>( // for each digit d of pi, includes "." which is always
                                  //     in the random number
      r[i=r.indexOf(d)]=_,        // i = position of d within r, remove digit from r
                                  // "_" is the unused function argument (equals undefined)
      ~i?d:"x"                    // if found, leave the digit, else replace with x
    ))

Test
Test outputs the random number also.

var solution = _=>(r=[...n=Math.random()+""],Math.PI+"").replace(/./g,d=>(r[i=r.indexOf(d)]=_,~i?d:"x"))
<button onclick="result.textContent='Result: '+solution()+'\nNumber: '+n">Go</button>

Couldn't random() produce 15 zeros in which would correspond to 0.000... or 1.000... ?  i.e. not between 0 and 1.

@ChrisDegnen Math.random() produces a number of the range [0,1) so it could 0 but never 1. The OP didn't specifically state whether the range was inclusive or exclusive so I assumed that whatever was reasonable is fine. This is also the range that the other answers use. However you have made me aware that if it is exactly 0 it will fail because the . in pi will not be matched and become x. This has a 1 in 2^53 chance of happening but I decided to fixed it anyway.

:-) sorry 'bout that.

The likelihood of hitting exactly 0 or 1 for a random double is negligible, so for the purpose of this challenge a range [0,1] is fine (so is (0,1)).

Nice. I propose a shorter variant.

CJam, 48 46 42 38 36 bytes
P`'xf+1dmr`{1$f#:!1a/0=:)W+H<.%}/1f=

Test it here.
And here is the version which prints both π and the random number:
P_p`'xf+1dmr`_oNo{1$f#:!1a/0=:)W+H<.%}/1f=

Test it here.
I do not truncate the random number to 15 decimal places, as clarified by the OP in a comment.
Explanation
The idea is to turn each character in the string representation of π into a pair of that character and x. For each character in the random number, we swap the first pair which starts with that character. At the end we output the second character of each pair.
P`      e# Get string representation of π.
'xf+    e# Append "x" to each character.
1dmr`   e# Get string representation of random number in [0,1).
{       e# For each character in that string...
  1$    e#   Copy the list of pairs.
  f#    e#   For each pair, find the index of the current character. If the character is
        e#   not in the pair, we get -1 (truthy). If it is the first character of the pair,
        e#   we get 0 (falsy). If it is the second character, we get 1 (truthy).
  :!    e#   Logical NOT for each of the results. We get a 1 for every pair we could
        e#   potentially swap.
  1a/   e#   Split around those 1s.
  0=    e#   Keep only the first chunk.
  :)    e#   Turn all the 0s into that chunk into 1s.
  W+    e#   Append a -1.
  H<    e#   Truncate to 17 elements (the number of pairs).
  .%    e#   Apply % pairwise. This reverses the element at the position of the -1.
}/
1f=     e# Select the second character from each pair.

Lua, 231 230 bytes
m,s=math,""p,r=m.pi..s,s..m.random()p=p:sub(1,#p-1)p:gsub(".",function(c)s=s..(47>c:byte()and c or"x")end)r:gsub("[^%.]",function(c)l=p:find(c)if l then p,s=p:sub(1,l-1).."x"..p:sub(l+1),s:sub(1,l-1)..c..s:sub(l+1)end end)print(s)

Explanations
function f()
  m,s=math,""
  p,r=m.pi..s,s..m.random()
  p=p:sub(1,#p-1)                       -- remove the last digit of math.pi

  p:gsub(".",function(c)
    s=s..(47>c:byte()and c or"x")      -- Construct a string full of "x" with a single dot
  end)

  r:gsub("[^%.]",function(c)            -- Iterate over each character but the dot in the random number
    l=p:find(c)                         -- if c isn't in pi, l=nil
    if l                                -- which is one of the two falsy value in lua
    then
      p,s=p:sub(1,l-1).."x"..p:sub(l+1),-- If c is in pi, we replace it in p by an x
          s:sub(1,l-1)..c..s:sub(l+1)   -- and in s by its value
    end
  end)
  return s
end

Sadly, lua doesn't help me at all here. math.pi round the last digit of pi it return :
print(math.pi)
>> 3.1415926535898

I have to truncate this number :
stringPI=""..math.pi
print(stringPI:sub(1,#stringPI-1))
>> 3.141592653589

The second big default to do this challenge was lua lack of string.replace(). As I'm doing this action twice using s:sub(1,l-1)..c..s:sub(l+1), I wanted to do an anonymous function, thinking it would be shorter. It isn't, so I kept it written twice.
The reason I have to be careful about the dot, is how lua return its position. In regexes, a dot mean "any character", so when i'm evaluating the character . in my loop it matches the first character :
c="."  -- The value of the dot in the loop
found = stringPI:find(c)
print(stringPI)
print("location of \".\": "..found)
print("char at "..found..": "..stringPI:sub(found,found))

>> 3.141592653589
>> location of ".": 1   --Keep in mind that lua arrays are 1-based :)
>> char at 1: 3

You can test lua online. As I am not seeding the PRNG, here's a code allowing you to run several test while still watching values.
function f()m,s=math,""p,r=m.pi..s,s..m.random()print("Random number: "..r)p=p:sub(1,#p-1)p:gsub(".",function(c)s=s..(c:byte()<47 and c or"x")end)r:gsub("[^%.]",function(c)l=p:find(c)if l then p,s=p:sub(1,l-1).."x"..p:sub(l+1),s:sub(1,l-1)..c..s:sub(l+1)end end)return s end

for i=1,10
do
    print(f())
end

Python 2.7, 117 110 bytes
import math,random
n=list(`random.random()`)
print''.join(n.pop(n.index(d))if d in n else'x'for d in`math.pi`)

Tested on the latest QPython Android app, but should work anywhere.
Edit 1: changed str(pi) to backticks.
For testing:
import math,random
n=list(`random.random()`)
print `math.pi`
print ''.join(n)
print''.join(n.pop(n.index(d))if d in n else'x'for d in`math.pi`)

Nice answer! The "apostrophes SO uses to mark code" are backticks or grove symbols, by the way :-)

Python, 147 bytes
import math as m,random as r
L=lambda t:[_ for _ in str(t)]
p=L(m.pi)
R=L(r.random())
A=""
print R #subtracted from byte count
for n in p:
    try:R.remove(n);A+=n
    except:A+='x'
print A

Fairly self-explanatory: lambda function converts float to list; we then loop through the pi-list attempting to remove each digit from the random-list. If we can, good, append it to the answer; if not, append an 'x' instead.

str(t) only gives you 11 digits of precision from t, repr(t) gives you all of t's 15 digits.

Perl, 70 bytes
$_=4*atan2(1,1);s/\d/x$&/g;for$i(rand=~/\d/g){s/x$i/$i/}s/x./x/g;print

With comments:
$_=4*atan2(1,1);        # Perl doesn't have a Pi constant
s/\d/x$&/g;             # prepend a x to all digits in Pi
for $i (rand=~/\d/g)    # iterate the digits in the random number
{ s/x$i/$i/ }           # replace first occurrence of x-nr pair
s/x./x/g;               # strip all remaining numbers
print                   # print!

This version will print pi, the random number, and the result:
$_=$p=4*atan2(1,1);
s/\d/x$&/g;
$r=rand;
for $i ($r=~/\d/g)
{ s/x$i/$i/ }
s/x./x/g;
print "$p\n$r\n$_\n"

Example output:
3.14159265358979
0.877757977767946
x.x4x59x6xxx897x

I hope this is okay:

pi contains 15 digits total, including the 3, so it doesn't exceed accuracy.
the last digit (9) is accurate.