text:
Generate a Kolakoski sequence
Definition1

A Kolakoski sequence is a self-describing infinite sequence {kn} of alternating blocks of 1's and 2's, given by the following rules:

k0 = 1
kn = the length of the (n+1)'th block

The Task
Given a positive integer n, generate the first n elements of the Kolakoski sequence.
Details
Input will be provided as a single command line argument n. Please write a full program that will print the first n elements of the Kolakoski sequence (in order) to STDOUT, with each element separated by your favorite whitespace.
Scoring
Lets count source code bytes this time with all whitespace included. Fewest number of bytes wins. In the event of a tie, the solution with the earliest submission time wins.
The Sequence2
1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, ...

References

John Smith, Ariel Scolnicov, yark. "Kolakoski sequence" (version 3). PlanetMath.org. Freely available at http://planetmath.org/KolakoskiSequence.html.

The Online Encyclopedia of Integer Sequences http://oeis.org/A000002

Other resources

Kolakoski Sequence at Wikipedia http://en.wikipedia.org/wiki/Kolakoski_sequence
Kolakoski Sequence at Wolfram MathWorld http://mathworld.wolfram.com/KolakoskiSequence.html

Any particular reason n is command line arg?

@CatsAreFluffy not originally, but i'll happily keep any requirement that adds a few irritating chars to the golf-oriented languages :)

That's a cumbersome I/O format that makes many languages unable to participate.

@Mego thanks for the tip. but in fairness to the current submissions, let's not go changing preferential specs on a 4 year old question

@ardnew I'm not saying to change it. I'm just saying it's not a good idea.

Note: reposting this question is being discussed on meta.

J - 23 char
A little late to the party, but I'd like to bust out a neat little J trick here.
1($1+2|I.)^:_~".>2{ARGV

Given input N, this verb operates by executing N&($1+2|I.) on a starting argument of 1 until it reaches a fixed point. If the item at index i in y is n, there will be n copies of i in I.y, so for instance I. 0 1 1 0 0 3 1 is 1 2 5 5 5 6. We mod the result of that by 2 and add one. Then, x $ y forces y into a list of length x, truncating it or extending it cyclically as necessary.
So here's what happens when the input is, say, 10.
   10 ($1+2|I.)^:a: 1
1 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1
1 2 1 2 1 2 1 2 1 2
1 2 2 1 2 2 1 2 2 1
1 2 2 1 1 2 1 1 2 2
1 2 2 1 1 2 1 2 2 1

We start with a row of all 1s and then "settle down" into the Kolakoski sequence. First, it turns into 1 2 1 2 1 2... as each contiguous block of ones or twos is described by length 1. Then we apply it again and it turns into 1 2 2 1 2 2 1 2 2... since the ones are described by 1 and the twos are described by 2. The we continue again and again until we see there is no change, at which point we stop and give the result.
Other "self-describing" sequences can be similarly derived in J using I. and ^:_.

Edit
Over a year ago, @ardnew asked:

what is the relationship between n and the number of those intermediate iterations required to generate the sequence of length n?

To make sure we're on the same page, I consider the calculation for n = 10 above to have taken 5 iterations.
If there are s terms settled at the i-th iteration for n, then at the (i+1)-th iteration, there will be (at least) k0 + k1 + ... + ks + 1 terms settled. The '+ 1' appears because the next term will also be correct, since it must be and is different from the term before it.
So if K(s) is the sequence of partial sums of kn, then we can lower bound the number of iterations for n by the least a such that (1+K)a(1) ≥ n. I don't how to prove we don't accidentally do a bit better (by picking up more correct terms than we expected in some iteration), but according to the numbers, we don't:
   k =: ($ 1 + 2 | I.)^:_&1               NB. Kolakoski seq
   pk =: +/\ @: k                         NB. partial sums ("K")
   ((1 + pk 2000) {~ <:) ::_:^:(i.20) 1   NB. iterating 1+K, say, 20 times
1 2 4 7 11 18 28 43 65 99 150 226 340 511 768 1153 1728 2590 _ _
   NB. compare with observed number of settled terms up to 2000:
   +/"1 }. (k <./\ . ="1 ($1+2|I.)^:a:&1) 2000
1 2 4 7 11 18 28 43 65 99 150 226 340 511 768 1153 1728 2000

The underscores are index errors (:: _:), telling us 20 iterations is too much for the first 2000 terms of kn to handle.

what is the relationship between n and the number of those intermediate iterations required to generate the sequence of length n?

@ardnew Long overdue, but I took at look at how the iterations thing acts.

Ruby (73 characters)
s=[1,2,2];n=2;ARGV[0].to_i.times{puts s[n-2];s[n].times{s+=[1+n%2]};n+=1}

GolfScript (48 chars)
You can't test this online because the online GS shell doesn't take command-line arguments, but:
;"#{ARGV[-1]}"~[1 2.]2{.2$=[1$2%)]*@\+\)}3$*;<n*

This takes input from stdin instead and works
~[1 2.]2{.2$=[1$2%)]*@\+\)}3$*;<n*

Your 48-char version does work if you change ARVG to ARGV ;o). E.g., golfscript.rb kola.gs 10.

Python 93
Adapted from my solution to Calculate the nth term of Golomb's self-describing sequence:
import sys;n=int(sys.argv[1]);a=[1,2,2];
for i in range(3,n):a+=[~i%2+1]*a[i-1]
print a[:n]

Still trying to figure out how to do this with list comprehension which I just learned about today, but I'm running into problems with self-reference.
EDIT: Instead of breaking if list was too long, just printed the appropriate slice.
EDIT: Now pulling arg from command line

n is never set prior to being referenced (either hard coded or read in from user). The code fails to run successfully.

It's required to use command-line input of what you call n, which will add some characters; however, you can save some by indenting only one space.) That's a very nice approach! Here's a 69-char Ruby version: s=[1,2,2];n=3;ARGV[0].to_i.times{puts s[n-3];s+=[~n%2+1]*s[n-1];n+=1}.

Reading from command line the way I did it (is there a better way?) would add 28 characters to this code for a total of 93 characters. Still cool and still kills my noob attempt but 65 chars, it ain't.

Yeah, it's the import sys and the lengthy sys.argv that really kills it. thanks for the tips.

Python (87 chars)
My code turned out to be basically the same as scleaver's solution even though I wrote it independently. It saves a few characters by not shifting the index i by 1.
import sys
n=int(sys.argv[1])
l=[1,2,2]
for i in range(2,n):l+=[1+i%2]*l[i]
print l[:n]

Perl, 41 39 bytes
A trivial modification of the classic TPR(0,3) solution:
perl -E 'say$_=($.+=!--$.[$.])%2+1for@.=(0)x pop' 20

Haskell 157 144
Haskell is kind of verbose so I expect this will be significantly longer than the shortest answer, but here it is.
import System
a=1:2:drop 2(concat.zipWith replicate a.cycle$[1,2])
main=do args<-getArgs;putStr$concatMap((' ':).show)$take(read$args!!0::Int)a

Edit:
Implemented FUZxxl's suggestions and also a few other small fixes.

Try to separate the statements in the do block with semicolons instead of newlines. That might help. Ans: (\b->' ':show b) is equal to ((' ':).show). Additionally, you might want to factor out a into a global variable to get rid of the phony let.

Brain-Flak, 128 bytes
(({}<((())<>)>)<{({}[()]<{{({}[()])<>(({}))<>}{}<>(()()()[{}])<>}<>{({}<>)<>}(())<>>)}>){({}[()]<({}<>)<>>)}{}{{}}<>{({}<>)<>}<>

Try it online!

Python (118 characters)
Takes n as a command line argument. Could trim four more characters if the printing of first n  requirement is relaxed to first n or n + 1. I can't think of any more fat to trim...will be interested to see what a more experienced Python golfer could do
import sys
k,b=[1,2,2],1
n=int(sys.argv[1])
while len(k)<n:k.extend([2,1][b%2]for z in range(k[b+1]));b+=1
print k[:n]

Perl, 59 chars
say"@{[map{push@a,(2-$_%2)x($b=$a[$_-1]||$_);$b}1..shift]}"

As usual, run with Perl 5.10+ and the -M5.010 switch to enable the say feature.

perl5.24.1 -M5.010 -E 'say"@{[map{push@a,(2-$%2)x($b=$a[$-1]||$);$b}1..shift]}"'  ; produces no digits ;  perl5.24.1 -E 'print "@{[map{push@a,(2-$%2)x($b=$a[$-1]||$);$b}1..shift]}"' ; also does nothing

@AlexxRoche: You need to give the number of elements you want as a command line parameter, e.g. perl -E 'print "@{[map{push@a,(2-$_%2)x($b=$a[$_-1]||$_);$b}1..shift]}"' 50 for the first 50 elements. If you omit the length, the code defaults to printing zero elements.

Javascript (414 Characters)
function range(n,e,t){if("undefined"==typeof e&&(e=n,n=0),"undefined"==typeof t&&(t=1),t>0&&n>=e||0>t&&e>=n)return[];for(var i=[],r=n;t>0?e>r:r>e;r+=t)i.push(r);return i}function kolakoskiGen(n){var e=[1,2,2],t=parseInt(n),r=range(2,t);for(i in r)if(-1!=r.indexOf(parseInt(i))){var f=[1+i%2];f.length=f.length*e[i],f[f.length-1]=f[0],2==f.length?(e[e.length]=f[0],e[e.length]=f[1]):e[e.length]=f[0]}console.log(e)}

Could probably be more Efficient

Hi Shubshub, welcome to the site! Since this is a [tag:code-golf] challenge, all answers are expected to attempt to make the code as short as possible. You should look through this page giving tips on how to golf your code, and then [edit] this post to include your new shorter code.


text:
Calculate the nth term of Golomb's self-describing sequence
Inspired by the previous question.
Golomb's self-describing sequence g(n) is a sequence where any natural number n is repeated within the sequence g(n) times.
The first few numbers in the sequence are:
n    1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 16 17 18 19 20
g(n) 1  2  2  3  3  4  4  4  5  5  5  6  6  6  6  7  7  7  7  8

You can see that g(4)=3, and that "4" is repeated 3 times in the sequence.
Given an input of n, output g(n).
Limitations: n < 100000.
Smallest code wins.

For naïve approaches this is the same as the previous question except that it uses n rather than 2 - n % 1. Do you have any reason to expect answers to be significantly different?

In Haskell, you can use this: golomb=1:2:2:concat(zipWith replicate(drop 2 golomb)[3..])

@PeterTaylor: I didn't know that.

GolfScript (31 chars)
~([1 2.]2{.2$=[1$)]*@\+\)}3$*;=

Demo

Nice, but have you really tried this with n=99999, and if so, how long did it take?  (When I tried it, it ran for an hour before hitting the 100 MiB memory limit I'd set for it and crashing.)

@IlmariKaronen, no. The question doesn't set any limits on memory or time efficiency, so I assume that the bound on the input size is for those languages which have fixed-width ints.

Jelly, 10 bytes
’ßßạ¹ß‘µṖ¡

This uses the recursive formula a(1) = 1, a(n + 1) = 1 + a(n + 1 - a(a(n))) from the OEIS page.
Try it online!
How it works
’ßßạ¹ß‘µṖ¡ Main link. Input: n

’          Decrement; yield n - 1.
 ßß        Recursively call the main link twice, with argument n - 1.
   ạ¹      Take the absolute difference of a(a(n - 1)) and n.
     ß     Recursively call the main link, with argument n - a(a(n - 1)).
      ‘    Increment the result, yielding 1 + a(n - a(a(n - 1))).
       µ   Combine the chain to the left into a single link.
        Ṗ  Pop [1, ..., n]. This yields [] iff n == 1.
         ¡ Execute the chain iff Ṗ returned a non-empty array.

PHP - 63 Chars

function g($n){for(;++$i<=$n;){for(;++$j<=$i;){echo $i;}$j=0;}}

Fast AND short.
I appear to have had the wrong sequence in mind. Derp.
This is CORRECT, fast, and short.
function g($n){for(;++$i<$n;){echo round(1.201*pow($i,.618));}}

Accuracy may suffer past the required 100,000 mark, but I did in fact meet the mark.

Oasis, 7 bytes (non-competing)
Code:
n<aae>T

Try it online!
Oasis is a language designed by Adnan which is specialized in sequences.
Currently, this language can do recursion and closed form.
The T at the end is shorthand for 10, which indicates that a(0) = 0 and a(1) = 1. To add more testcases, simply add to the list at the end.
n<aae>T
n<aae>10  expanded

       0  a(0) = 0
      1   a(1) = 1

n         push n (input)
 <        -1
  a       a(above)  [a is the sequence]
   a      a(above)
    e     a(n-above)
     >    +1

Now we essentially calculated a(n-a(a(n-1))+1.

PHP
This recursive version is shorter (60) but computationally inefficient:
function g($n){return$n==1?1:1+g($n-g(g($n-1)));}echo g($n);

This is much faster but longer (78):
$a=[1,2,2];for($i=3;$i<$n;$i++)for($j=0;$j<$a[$i-1];$j++)$a[]=$i;echo$a[$n-1];

Much faster, but at 89 characters would be:
$a=[1,2,2];for($i=3;!isset($a[$n-1]);$i++)for($j=0;$j<$a[$i-1];$j++)$a[]=$i;echo$a[$n-1];

Which is O(n)

Haskell, 30 27 Chars
g 1=1
g n=1+(g$n-g(g$n-1))

Welcome to the site!

APL (Dyalog Classic), 24 19 bytes
{⍵=1:1⋄1+∇⍵-∇ ∇⍵-1}

-5 bytes from ngn's suggestion.
Try it online!
Same as the recursive function used in the PHP answer.
{⍵=1:1⋄1+∇(⍵-∇(∇(⍵-1)))} ⍵(left arg) is n
       1+∇(⍵-∇(∇(⍵-1)))  recursive step: return 1 + f(n - f(f(n - 1))) if n is not 1.
 ⍵=1:1                   if n is 1, then return 1.

you can rm all ( ) and insert a space between the two ∇s

Please don't use Classic unless there's a really good reason to do so.

APL (Dyalog Extended), 11 10 bytes
⊢/⎕⍴∘⍸⍣≡,1

Try it online!
-1 byte by converting to a full program, thanks to Adám.
Also works in Dyalog APL 18.0. (TIO's version is 17.1, so Extended is used for the extended functionality of ⍸.)
A port of randomra's J answer as a full program.
⊢/⎕⍴∘⍸⍣≡,1
      ⍣≡    ⍝ Repeat until convergence
       ,1   ⍝ with the starting value of [1]:
     ⍸      ⍝   Convert [a b c ...] into a copies of 1, b copies of 2, ...
  ⎕⍴∘       ⍝   and take first n values (recycling values if necessary)
⊢/          ⍝ Get the rightmost element

-1: ⊢/⎕⍴∘⍸⍣≡,1 Try it online!

Python - 64 chars
n=input()
g=[1,2,2]
for i in range(3,n):g+=[i]*g[i-1]
print g[n]

That's nice. I didn't think doing [i]*g[i-1] would do that so I bent over backwards to do it another way; I thought it would behave more like multiplying a matrix by a scalar for some reason...

Perl, 48 chars
(@a=(@a,($,)x($a[$,++]||$,)))<$_?redo:say$,for<>

Input on stdin, output to stdout.  Needs Perl 5.10+ and the -M5.010 to enable the sayfeature.  Takes about O(n2) time due to inefficient array manipulation, but still fast enough to easily calculate up to the 100,000th term.

Julia - 28
By a recursive way:
a(n)=n==1?1:1+a(n-a(a(n-1)))

Output:
[a(i) for i=1:20]'
1x20 Array{Int64,2}:
 1  2  2  3  3  4  4  4  5  5  5  6  6  6  6  7  7  7  7  8

Javascript, 93 chars
c=[,1],i=c.length;function g(n){for(i;i<n;i++) c[i]=g(i);return c[n]||(c[n]=1+g(n-g(g(n-1))))}

J, 43 characters
f=:3 :'<.@:+&0.5(p^2-p)*y^p-1[p=:(+%)/20$1'

Defines a function using the asymptotic expression given on the wikipedia page.
   f 5
3
   f 20
8
   f 100000
1479

Annoyingly 9 characters are used just rounding to the nearest integer.

Prelude, 69 55 54 bytes
?1-(v  #1)-
1   0v ^(#    0 (1+0)#)!
    (#)  ^#1-(0)#

If a standard compliant interpreter is used, this takes input and output as byte values. To actually use decimal numbers on STDIN/STDOUT, you'd need the Python interpreter with NUMERIC_OUTPUT = True and an additional option NUMERIC_INPUT = True.
Explanation
The skeleton of the program is
?1-(    1 -
1                     )!

We read the input N onto the first voice and decrement it to get N-1. We also initialise the second voice to 1. Then we loop N-1 one times, each iteration of which gets the next value of the sequence on the second stack. At the end we print the Nth number.
The idea of the program is to put each element of the sequence in a queue on the third voice, and to decrement the head of that queue in each iteration. When the head reaches 0, we increment the value of the sequence and remove that 0.
Now the issue is that Prelude uses stacks and not queues. So we need to shift around that stack a bit to use it like a queue.
v  #
0v ^
(#)

This copies the current value of the sequence to the first voice (as a temporary copy), pushes a 0 onto the second voice (to mark the end of the queue). And then performs a loop to shift (and thereby reverse) the third stack onto the second. After the loop, we put the copy of the current sequence value on top of the second stack (which is the tail of our queue).
 )
(#
 ^#1-

This looks a bit ugly, but essentially it's a loop that shifts the stack back onto the third voice. Since the ) is in the same column as the shifting instructions, the 0 we put on the second voice earlier will also end up on the third voice, so we need to remove it with another #. Then decrement the top of the 3rd voice, i.e. the head of the queue.
Now it gets a bit annoying - we want run some code when that value is 0, but Prelude's only control structure (the loop) only responds to non-zero values.
 0 (1+0)#
(0)#

Note that the top of the second voice is truthy (since the Golomb sequence does not contain any 0s). So the workload goes into that voice (the latter pair of parentheses). We just need to prevent that from happening if the head of the queue isn't 0 yet. So first we have a "loop" on the third voice which pushes a 0 onto the second voice if the head of the queue is still non-zero. We also put a 0 on the third voice to exit the loop right away. The # on the third voice then either removes that 0, or removes the head of the queue if that was already zero. Now that second loop is only entered if the head of the queue was zero (and the 0 on the second voice was never pushed). In that case we increment the current value of the sequence and push a 0 to exit the loop. Lastly, there will always be a 0 on top of the stack, which we need to discard.
I told you that logical negation is annoying in Prelude...

Mathematica, 27 bytes
f@1=1;f@n_:=1+f[n-f@f[n-1]]

Another recursive solution.

CJam, 14 bytes
CJam is much younger than this challenge, so this answer is not eligible for the green checkmark. However, it's quite rare that you get to use j this nicely, so I wanted to post it anyway.
l~2,{_(jj-j)}j

Test it here.
Explanation
j is basically the "memoised recursion operator". It takes an integer N, an array and a block F. The array is used to initialise the memoisation: the element at index i will be returned for F(i). j then computes F(N), either by looking it up, or by running the block (with n on the stack) if the value hasn't been memoised yet. The really nifty feature is that within the block, j only takes an integer i, and calls F(i) recursively. So here is the code:
l~             "Read and eval input.";
  2,           "Push a 2-range onto the stack, i.e. [0 1]. The first value is irrelevant
                but the second value is the base case of the recursion.";
    {       }j "Compute F(N).";
     _(        "Duplicate i and decrement to i-1.";
       jj      "Compute F(F(i-1)).";
         -     "Subtract from i.";
          j    "Compute F(n-F(F(i-1))).";
           )   "Increment the result.";

J, 16 bytes
    <:{1($1+I.)^:[~]

    (<:{1($1+I.)^:[~]) every 1+i.20  NB. results for inputs 1..20
1 2 2 3 3 4 4 4 5 5 5 6 6 6 6 7 7 7 7 8

This solution is heavily based on algorithmshark's solution to a similar problem. You can find some explanation about this method there.
J, 33 bytes
In this approach I build up a sequence h(k) with the values of the first indexes i where the g(i)=k so h = 1 2 4 6 9 12 16.... We can get h(k) fairly simply from h(1..k-1) with the expression ({:+1+[:+/#<:]) where the input is h(1..k-1).
Computing the output from h is straightforward. h ([:+/]>:[) input
[:+/]>:1 2(,{:+1+[:+/#<:])@]^:[~]

Brachylog, 13 bytes
1|-₁↰↰:?-ṅ↰+₁

Try it online!
Explanation
1                Input = 1 = Output
 |               Or
  -₁↰            a(Input - 1)
     ↰           a(a(Input - 1))
      :?-ṅ       Input - a(a(Input - 1))
          ↰      a(Input - a(a(Input - 1))
           +₁    1 + a(Input - a(a(Input -1))

Python - 76 chars
n=20;g=[1,2,2];[[g.append(i)for j in range(g[i-1])]for i in range(3,n)];g[n]

This actually fills the list with a bunch of Nones. Seems to be the "correct" amount of Nones tho :)

@Daniero yeah it's kind of weird code. I had to run it a couple of times to convince myself it actually worked. It fills the list comprehension with a bunch of Nones since list.append() returns None type. I just used the nested list comprehensions to achieve a nested loop. The only purpose of the list comprehensions here is to cause the code to loop the right number of times - they are throw away values

It saves two characters over if I had done traditional nested loops :)

Unfortunately it seems you're hard-coding the input, which we don't allow, and assuming a REPL environment, which would make this a snippet. By default, all submissions must be full programs or functions which use one of our default I/O methods rather than snippets. Let me know if you have any questions.

@AlexA. Doing a bit of archeology?

@chucksmash Haha, I only realized how old this is after I commented. I was responding to a flag in which someone brought up the concerns I mentioned in my comment.

@chucksmash Please fix the answer or delete it.

JavaScript - 48 Characters
for(g=[,i=j=k=1,2];i<1e5;k=--k?k:g[++j])g[i++]=j

Creates a 1-indexed array g containing the sequence values.
Edit - JavaScript - 46 Characters
v=[,1];for(x=2;x<1e5;)v[x]=1+v[x-v[v[x++-1]]]

Creates a 1-indexed array v containing the sequence values.
Edit 2 - ECMAScript 6 - 27 Characters
g=x=>x-1?1+g(x-g(g(x-1))):1

The first two are reasonably fast - the third is very slow

Haskell, 63 bytes
f n|n<3=n|n<4=2|1>0=foldr1(++)[replicate(f m)m|m<-[1..]]!!(n-1)

This is the naive approach, I was not aware of the very short recurison when I wrote this, but I thought I'd post it anyway, even tough it is longer than all other Haskell implementations, as e.g.
Calculate the nth term of Golomb's self-describing sequence
and
https://codegolf.stackexchange.com/a/23979/24877

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:
matrix determinant
Calculate the determinant of an n x n matrix.
Rules

read matrix from standard input
write to standard output
do not use ready solutions from library or language
input: columns separated by any space char
input: lines separated by cr and/or lf

Winner

The shortest code :)

I'm 4'6". Do I win?

Looks like Chandra Bahadur Dangi wins this competition at 1 ft 11 in.  First competition ever won by somebody who's probably never heard of the site :)

Is the matrix over any particular ring?

Just Q I assume.

NB this question is superseded by https://codegolf.stackexchange.com/q/147668/194

GolfScript, 58 chars
n%{~]}%{[.!{(.,,0\{:^2$=-1^?*3${.^<\^)>+}%d*+}/}or])\;}:d~

A straightforward recursive algorithm using Laplace expansion.
Example input (random 5 × 5 matrix):
-562   40   43 -586  347
-229  177  305 -367   50
-434  343  241 -365  -86
-3   -384 -351   61 -214
-400   96 -339   25 -116

Output: 282416596900 (Online demo; Verify with Wolfram Alpha)
The code consists of three parts:

n%{~]}% parses the input,
{[.!{(.,,0\{:^2$=-1^?*3${.^<\^)>+}%d*+}/}or])\;}:d defines a recursive subroutine to calculate the determinant, and
the final ~ applies the subroutine to the input.

I'm sure there's room for improvement in this code, but at least I beat Gareth by three chars.  Also, {:^2$= is a pretty nice GS smiley. :)

Message from online demo: "Code took longer than 5 seconds to run, so it was aborted."

@David: Try reloading or running the script locally; the server seems to be overloaded or something.  GolfScript may be slow, but not that slow.

You were right. It ran now in 1.14 secs.

@IlmariKaronen No need to beat my solution since it doesn't actually work. :-)

Haskell, 139 131
(a:r)%0=r;(a:r)%n=a:r%(n-1)
d[]=1;d(f:r)=foldr(\(j,x)->(x*d(map(%j)r)-))0$zip[0..]f
main=interact$show.d.map(map read.words).lines

+1: short, working and matches the spec. Demo on ideone.

Python, 369
This is ridiculously long, but I thought I'd provide a solution that implements the Leibniz formula.
def f(l):
    if len(l)==1:return [l]
    a=[]
    for s in l:
        for p in f(list(set(l)-set([s]))):a+=[[s]+p]
    return a
def s(a):
    n=1
    for i in range(len(a)):n*=(-1)**(a[i]>i);a[a.index(i)]=a[i];a[i]=i
    return n
m=[map(int,w.split(','))for w in raw_input().split(' ')]
r=range(len(m))
print sum([reduce(lambda x,y:x*y,[m[p[i]][i] for i in r],1)*s(p) for p in f(r)])

Values are read from stdin in a format like 1,2,-3 7,0,4 -1,-3,0 with a single space between columns. I wouldn't have posted this, but it was fun to write and contains a couple interesting sub-problems. The function f generates all permutations of n elements, and the function s determines the parity of those permutations.

import is your friend... itertools implements permutations for you.

In these code golf challenges I prefer to use my own implementations, especially if I don't have a shot at winning as is. You're right though, itertools' permutations is exactly what I needed.

Y'know, if the sole argument to a function is list comprehension, you can often just pass in a generator: sum([reduce... for p in f(r)]) can be sum(reduce... for p in f(r)).

You can eliminate three characters by removing some of the spaces: return [l]=>return[l], m[p[i]][i] for=>m[p[i]][i]for, and s(p) for=>s(p)for.

Python, 198
This also uses the Liebniz formula.  I'm using a heavily-modified version of ugoren's permutation solution to generate permutations and their inversion counts simultaneously. (edit: now correct!)
t=input()
e=enumerate
p=lambda t:t and((b+[a],j+i)for i,a in e(t)for b,j in p(t[:i]+t[i+1:]))or[([],0)]
print sum(reduce(lambda t,(i,r):t*r[i],e(p),1-i%2*2)for p,i in p([t]+[input()for x in t[1:]]))

Python 233
def d(x):
 l=len(x)
 if l<2:return x[0][0]
 return sum([(-1)**i*x[i][0]*d(m(x,i))for i in range(l)])
def m(x,i):y=x[:];del(y[i]);y=zip(*y);del(y[0]);return zip(*y)
x=[input()]
for i in (len(x[0])-1)*[1]:x+=[input()]
print d(x)

Ungolfed:
def det(x):
    l = len(x)
    if l == 1:
        return x[0][0]
    return sum([(-1)**i*x[i][0]*det(minor(x,i+1,1)) for i in range(l)])

def minor(x,i,j):
    y = x[:]
    del(y[i-1])
    y=zip(*y)
    del(y[j-1])
    return zip(*y)

def main():
    x = [input()]
    for i in range(len(x[0])-1):
        x += [input()]
    print det(x)

if __name__ == '__main__':
    main()

Usage
As requested, input is on stdin and output is to stdout.
I interpreted columns separated by any space char to mean that I can use comma delimited numbers. If this is not the case, I will rework my solution.
This could be about 30 characters shorter if I could specify my input matrix in the form [[a,b,c],[d,e,f],[g,h,i]].
./det.py
1,-4,9
-6,7,3
1,2,3

Result
-240

The determinant is found using Laplace Expansion

I'm working on a python solution myself, but when I input that test matrix I get -240 as the determinant. Looking elsewhere online confirmed that -240 is correct. Perhaps you typed the test case wrong when you submitted?

@scleaver, yes you are correct, I just typed that wrong, I will correct it.

One character can be golfed by removing the space: in (len...=>in(len

J, 61 characters
-/>([:+/#(([{.<:@[}.])[:*//._2,\2#])])&.>(|.;])".];._2[1!:1[3

A big ugly bit of code that takes its input from stdin (if you're running this on Windows you may need to change ".];._2[1!:1[3 to ".}:@];._2[1!:1[3 to ensure both character return and line feed are removed).
   -/>([:+/#(([{.<:@[}.])[:*//._2,\2#])])&.>(|.;])".];._2[1!:1[3
1 8 5
2 7 3
9 9 4
_72
   -/>([:+/#(([{.<:@[}.])[:*//._2,\2#])])&.>(|.;])".];._2[1!:1[3
_2 2 3
_1 1 3
2 0 _1
6

Of course, no-one using J would ever bother to do this. They'd just use:
(-/ .*)".];._2[1!:1[3

making use of the . determinant verb.

I'm not really familiar with J, so I could just be doing something wrong, but I'm getting the wrong answer for [[7,8,5,4],[3,9,-5,3],[-9,5,7,3],[6,4,2,1]] (I get -426)

@Matt Hmm...a good example of this I think. :-) I saw the way to calculate the determinant for a 3x3 matrix and used that without checking if that was the correct way. Oops. Still somehow managed to gain an upvote for it. I'll come back and either correct it or just give the invalid solution.

Haven't checked this myself, but you may be able to use the ideas in this essay to golf it down further.

Dyalog APL, 53 58 59 characters
{1=≢⍵:⊃⍵⋄-/⍵[1;]×∇¨{w[f~1;f~⍵]}¨f←⍳⊃⍴w←⍵}U⍪↑{⎕}¨1↓⍳⍴U←⎕

I'm pretty late to the party here.
Please, alert me if there are any issues with this code!
Takes negatives as input via ¯ (the APL negative sign). I think values by default go to STDOUT in APL, but I may be wrong.
Uses Laplace expansion to find the determinant of the matrix.
This program is separated into three main parts: an input section, and the case of a 1x1 matrix, and the actual recursive function.
Input program:
U⍪↑{⎕}¨1↓⍳⍴U←⎕
             ⎕ - Takes evaluated input, space separated numbers are vectors in APL.
           U←  - Stores the input into variable `U`.
         ⍳⍴    - The array of integers from 1 to the length of `U` (inclusive).
       1↓      - Drops the first element of the result.
   {⎕}¨        - Receives a new input for each element in the vector. (Result is a vector of vectors)
  ↑            - Transforms the vector vector into a 2D-array.
U⍪             - The original line was stored then used for its length, so we stick it on top of the new array.

1x1 case:
{1=≢⍵:⊃⍵⋄...}
       ⍵      - The input
      ⊃       - The first element of the input
     :        - Return that if and only if ...
   ≢⍵         - The largest dimension of the input matrix
 1=           - Has equality with 1.
        ⋄     - Statement separator
{           } - Function enclosure brackets.

Actual determinant program:
{...-/⍵[1;]×∇¨{w[f~1;f~⍵]}¨f←⍳⊃⍴w←⍵}
                                w←⍵  - The input stored in `w`
                               ⍴     - The dimensions of `w`
                              ⊃      - The first dimension
                             ⍳       - 1 to the result of last operation
                           f←        - Store the result in `f`
              {          }¨          - Do what is inside the brackets to each member of `f`
               w[f~1;f~⍵]            - Return the minor matrix.
            ∇¨                       - Find determinant of each element (recursive)
      ⍵[1;]×                         - Multiply elementwise by the first row of the input matrix
    -/                               - Reduction using subtraction, since APL evaluates right to left, it comes out to be + - + - ...

Python, 181 characters
Late to the party, but here's a simple 181 character implementation of Laplace:
l,r=len,range
d=lambda A:sum((-1)**i*A[0][i]*d([[A[x][y]for x in r(1,l(A))]for y in r(i)+r(1+i,l(A))])for i in r(l(A)))if len(A)>1 else A[0][0]
print d(map(eval,iter(raw_input,'')))

This meets the specs if "any space character" includes commas, which seems to be the norm here. Otherwise,
l,r=len,range
d=lambda A:sum((-1)**i*A[0][i]*d([[A[x][y]for x in r(1,l(A))]for y in r(i)+r(1+i,l(A))])for i in r(l(A)))if len(A)>1 else A[0][0]
print d(map(lambda x:map(int,x.split(' ')),iter(raw_input,'')))

is 207 characters.
Input is terminated by entering a blank line.

Hey, don't complain about being late to the party now.  And you could save a character by changing len(A)>1 else to len(A)>1else.

Jq 1.5, 171 bytes
This is a golf-ed version of det from rosettacode Matrix arithmetic - jq.
def d:if[paths]==[[0],[0,0]]then.[0][0]else. as$m|reduce range(length)as$i(0;.+({"0":1}["\($i%2)"]//-1)*$m[0][$i]*($m|reduce del(.[0])[]as$r([];.+[$r|del(.[$i])])|d))end;d

Original
def except(i;j):
  reduce del(.[i])[] as $row ([]; . + [$row | del(.[j]) ] );

def det:
  def parity(i): if i % 2 == 0 then 1 else -1 end;
  if length == 1 and (.[0] | length) == 1 then .[0][0]
  else . as $m
    | reduce range(0; length) as $i
        (0; . + parity($i) * $m[0][$i] * ( $m | except(0;$i) | det) )
  end ;

Alterations:

replace base case condition with [paths]==[[0],[0,0]]
replace parity($i) with ({"0":1}["\($i%2)"]//-1)
replace except(0;$i) with inline definition
replace det,row with d,r and remove whitespace

Try it online!

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


text:
Array Sandwiches
(Adapted from Problem C of the first qualifier of the ACM Programming Contest of 2012/2013)
You have several arrays, named \$A_1, A_2, ... , A_n\$, each sorted in ascending order. Every item in the array will be a 32-bit integer.
A sandwich is a set of indices \$j_1, j_2, ... , j_n\$ such that \$A_1[j_1] ≤ A_2[j_2] ≤ ... ≤ A_n[j_n]\$. \$A_i[0]\$ is the first element of \$A_i\$.
Given some arrays, output every possible sandwich that you can have from those arrays, separated by a newline.
If there is somehow a built-in function which does this in your language, don't use it.
Input can be given in any way, output must be separated with whitespace, but can given in any order.
Test Case:
[[1, 5, 7, 10], [2, 6, 6, 8, 12], [4, 5, 9]]

Output:
0 0 0
0 0 1
0 0 2
0 1 2
0 2 2
0 3 2
1 1 2
1 2 2
1 3 2
2 3 2

Test Case:
[[10, 20, 30], [1, 2, 3]]

Output:
Shortest code wins.

What values can the arrays contain? Only positive integers?

@IlmariKaronen: They will contain negative integers as well.

@PeterTaylor: For simplicity, they will be 32-bit integers.

@DavidCarraher: It's the next test case. I should make it more clear.

Thanks. Now I see that my current solution only works for arrays of 3 elements. I'll have to work a bit more to generalize it.

In the original question each input array is guaranteed to be sorted in ascending order, and both test cases respect this. Can we assume it applies to this question too?

@PeterTaylor: Wow, I never noticed that line in the contest. Sure.

APL (33)
↑1-⍨B/⍨{(⍳⍴A)∘≡⍋⍵⌷¨A}¨B←,⍳⊃∘⍴¨A←⎕

Input is read from the keyboad, but it must be given as an APL list, i.e.
(1 5 7 10) (2 6 6 8 12) (4 5 9)

Explanation:

B←,⍳⊃∘⍴¨A←⎕: A is evaluated input, B is all possible sets of indices in the lists given in A.
{(⍳⍴A)∘≡⍋⍵⌷¨A}¨B: for each set of indices, get the values from the lists (⍵⌷¨A) and see if they are sorted ((⍳⍴A)∘=⍋)
B/⍨: select from B all sets of indices where the previous expression was true (i.e. all the sandwiches)
1-⍨: subtract one from all indices, because this question assumed 0-based arrays and APL-arrays are 1-based by default.
↑: arrange the list of sets of indices as a matrix (so each set is on its own line)

GolfScript, 51 chars
~:A{,}%{*}*,{A{,.@.@/\@%}%\;}%{:k,,{.A=\k==}%.$=},`

Example input (on stdin):
[[1 5 7 10] [2 6 6 8 12] [4 5 9]]

Example output (to stdout):
[[0 0 0] [0 0 1] [0 0 2] [0 1 2] [1 1 2] [0 2 2] [1 2 2] [0 3 2] [1 3 2] [2 3 2]]

(Note that input must be given without commas, otherwise the program will most likely crash.)

I guess I should add some explanation about how this code works:

~:A just evaluates the input as GolfScript code and assigns the result (an array of arrays) to A.  It also leaves a copy of A on the stack for the next step.
{,}% replaces each sub-array with its length, and {*}* multiplies those lengths together, giving the total number of possible sandwich candidates.  This number is then converted by , to an array of that many successive integers starting from 0.
{A{,.@.@/\@%}%\;}% converts each number into a the corresponding sandwich candidate (i.e. an array of valid indices into each sub-array in A).  For example, given the input above, 0 would map to [0 0 0], 1 to [1 0 0], 2 to [2 0 0], 3 to [3 0 0], 4 to [0 1 0] and so on.  (Figuring out exactly how the code accomplishes that is left as an exercise for the interested reader.)
{:k,,{.A=\k==}%.$=}, filters the sandwich candidates by mapping each of them to the corresponding elements of the sub-arrays of A (so that e.g. [0 0 0] would yield [1 2 4], [1 0 0] would yield [5 2 4], and so on, for the input above), sorting the resulting array and comparing it with an unsorted copy.  If they are equal, the array was already sorted, and thus the candidate is indeed a sandwich.
Finally, ` just turns the filtered array of sandwiches into a string for output.

They must be seperated by whitespace, so spaces or tabs work as well.

OK, I've changed the output format.

Mathematica, 120 130 bytes
Edit
This version works with arrays of varying sizes.

l = List;
g = Grid@Cases[Outer[l, Sequence @@ MapIndexed[l, #, {2}], 1]~Flatten~(Length[#] - 1),
x_ /; LessEqual @@ x[[All, 1]] == True :> x[[All, 2, 2]] - 1] &

Usage
g@{{10, 20, 30}, {1, 22, 3}}
g@{{1, 5, 7, 10}, {2, 6, 6, 8, 12}, {4, 5, 9}}
g@{{10, 20, 30}, {1, 2, 3}}
g@{{1, -2, 3}, {-12, -7, 8, 9, 6}, {3, 99, 9}, {100, 10, -23}, {90, 10}}

Explanation
Using the first example from above,
a = {{10, 20, 30}, {1, 22, 3}}

MapIndexed  sets indices for all the elements. N.B.: Mathematica begins counting with 1. (We'll later take that into account.)
MapIndexed[l, a, {2}]

{{{10, {1, 1}}, {20, {1, 2}}, {30, {1, 3}}}, {{1, {2, 1}}, {22, {2,
2}}, {3, {2, 3}}}}

Outer generates all lists, each a candidate as a sandwich array, and the indices of their elements; % contains the results from the prior output. The  numbers, 10 and 22 which I highlighted after they were output, refer to a sandwich array {10,22} that has yet to be identified as such.
Outer[l, Sequence @@ %, 1]~Flatten~(Length[a] - 1)

{{{10, {1, 1}}, {1, {2, 1}}}, {{10, {1, 1}}, {22, {2, 2}}}, {{10, {1,
1}}, {3, {2, 3}}}, {{20, {1, 2}}, {1, {2, 1}}}, {{20, {1,
2}}, {22, {2, 2}}}, {{20, {1, 2}}, {3, {2, 3}}}, {{30, {1,
3}}, {1, {2, 1}}}, {{30, {1, 3}}, {22, {2, 2}}}, {{30, {1,
3}}, {3, {2, 3}}}}

Cases tests each element of the above to determine whether a LessEqual (less than or equal) relation holds.  The results shown below are those instances in which array sandwiches were detected. Once again, I highlighted {10,22} in the output.
Cases[%, x_ /; LessEqual @@ x[[All, 1]] == True]

{{{10, {1, 1}}, {22, {2, 2}}}, {{20, {1, 2}}, {22, {2, 2}}}}

%% refers to the penultimate results. :>, [ RuleDelayed]  returns thos parts of the instances of interest, namely, the indices of the array sandwiches.  -1 corrects for the fact that Mathematica begins arrays with 1 instead of 0.
Cases[%%, x_ /; LessEqual @@ x[[All, 1]] == True :> x[[All, 2, 2]] - 1]

{{0, 1}, {1, 1}}

Grid displays the results in a grid. The first row 0   1 means the that  element 0 from the first sublist (i.e. 10) and the element 1 from the second sublist (i.e. 22) constitute the first sandwich array that was found.
Grid@%

0  1
1  1

I dislike this answer since you artificially simplify your answer by fixing the number arrays.

If you mean that it only works for arrays of 3 "rows", I share your dislike. The problem has to do with enabling LessEqual to work with arrays of indeterminate size. There may be other instances where the same assumption impedes generality. When I get a chance, I'll generalize the approach.

@FUZxxl  I was able to generalize the approach. Take a look.

@DavidC Why did you rollback my edit? Looks like the x_ /; etc. part is code and should be in a code block?

you are right.  I rolled back to your version.

Jelly, 10 bytes
J€Œpị"ṢƑ¥Ƈ

Try it online!
This uses 1-indexing which is the default for Jelly. +2 bytes to use 0-indexing.
How it works
J€Œpị"ṢƑ¥Ƈ - Main link. Takes a 2d array A on the left
 €         - Over each subarray:
J          -   Replace the subarray with its indices
  Œp       - Take the Cartesian product of these indices
        ¥Ƈ - Keep the indices for which the following is true:
    ị"     -   Index into each subarray of A
      ṢƑ   -   The resulting elements are in ascending order?

R - 89 chars
i=do.call(expand.grid,lapply(x,seq_along))
i[apply(diff(t(mapply(`[`,x,i)))>=0,2,all),]-1

where
x = list(c(1, 5, 7, 10), c(2, 6, 6, 8, 12), c(4, 5, 9))

or
x = list(c(10, 20, 30), c(1, 2, 3))

Python, 149 141 140
import itertools as I;x=input();r=range;print[p for p in I.product(*map(r,map(len,x)))if all(x[i][p[i]]<=x[i+1][p[i+1]]for i in r(len(x)-1))]

Python has a useful itertools library that can generate permutations. This just iterates over all possible permutations of valid indices and checks whether they satisfy the criteria.
I think I can make this shorter, still working on it.
Edit: Now all one line for your reading (in)convenience!

r=range will save one character.

Thanks for the tip. It never occurred to me that I can alias library functions.

Python 120
f=lambda p,k=0:['%i '%j+m for j,v in enumerate(p[0])if v>=k for m in f(p[1:],v)]if p else['']
print'\n'.join(f(input()))

... still think, "enumerate" is a very long word.

GolfScript (44 chars)
~{.,,]zip}%{{`{+}+1$\/}%\;}*{2%.$=},{(;2%}%`

Same input and output format as Ilmari's entry.
Demo
Rough breakdown:
Map each input row into an array of pairs [value index]
{.,,]zip}%

Fold a Cartesian product over the rows
{{`{+}+1$\/}%\;}*

Filter to those whose 0th, 2nd, 4th, etc. entries are non-decreasing.
{2%.$=},

Map each one down to its 1st, 3rd, 5th, etc. entries.
{(;2%}%

05AB1E, 20 bytes
εεN].«â€˜ʒεINèsè}¥dP

Indexing into matrices is not 05AB1E's strong suit.. :/
Try it online.
Explanation:
εεN]         #Transform the input to a list of lists of indices:
ε            # Map over each list of the (implicit) input-list:
 ε           #  Map over each inner value in this list:
  N          #   Push the map-index
   ]         # Close both maps

.«â€˜        #Create all combinations of the indices in each list:
.«           # Left-reduce the list of lists by:
  â          #  Taking the cartesian product
   €         # Then map over each inner list of nested lists:
    ˜        #  And flatten the values to a single list

ʒεINèsè}¥dP  #Filter to keep just the indices that are in ascending order
ʒ            # Filter the list of lists of indices by:
 ε           #  Map over each index:
  INè        #   Use the map-index itself to index into the input list of lists
     sè      #   Then use the index we're mapping over to index into this list
       }¥    #  After the map: get all the deltas / forward differences
         d   #  Check for each that they're non-negative (>=0)
          P  #  And check if this is truthy for all of them
             # (after the filter, the result is output implicitly)

Vyxal, 10 bytes
vẏΠ'?¨£iÞṠ

Try it Online!
Port of Jelly.

Q, 43
{f(&)m~'(asc')m:x@'/:f:(cross/)(!:')(#:')x}

Wolfram Language (Mathematica), 30 bytes
#<=##&~Outer~##~Position~True&

Try it online!
Returns 1-indexed. For 0-indexing, add -1 (+2 bytes).

JavaScript, 138 bytes
x=a=>(f=(a,p)=>a[0].flatMap((v,i)=>v<p?null:a[1]?(r=f(a.slice(1),v))&&r.map(j=>j&&[i,...j]):[[i]]))(a).map(i=>i?i.join(' ')+'\n':'').join('')

or more readable:
x = a => (f = (a, p) => a[0].flatMap(
  (v, i) => v<p
    ? null
    : a[1]
      ? (r = f(a.slice(1), v)) && r.map(j => j && [i, ...j])
      : [[i]]
  )
)(a).map(
  i => i
    ? i.join(' ') + '\n'
    : ''
).join('')

J, 22 bytes
#&>#:[:I.(-:/:~)@>@,@{

Try it online!
Takes input as boxed lists, as J does not allow heterogeneous arrays.

>@,@{ The open > of the flatten , of the Cartesian product {.  This is just one big matrix whose rows are the elements of the Cartesian product.
(-:/:~)@ Which of those matches itself sorted?  Returns a single 0-1 boolean list.
[:I. Indices of the ones.
#&>#: Convert to a mixed base number, where the bases are the lengths of the original input lists.

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


text:
Can you Golf Golf?
You are required to generate a random 18-hole golf course.
Example output:
[3 4 3 5 5 4 4 4 5 3 3 4 4 3 4 5 5 4]

Rules:

Your program must output a list of hole lengths for exactly 18 holes
Each hole must have a length of 3, 4 or 5
The hole lengths must add up to 72 for the entire course
Your program must be able to produce every possible hole configuration with some non-zero-probability (the probabilities of each configuration need not be equal, but feel free to claim extra kudos if this is the case)

Please confirm, 44152809 solutions?

I too am curious on the exact number of solutions, however I think it should be more than 44 million... (I am no mathmetician, however: |
1(5)/1(3) = 306 possibilities (1718) |
2(5)/2(3) = 69360 poss (17171615) |
3(5)/3(3) = 11182080 poss (1616161514*13) |
does that look right?

@baby-rabbit: I can confirm 44,152,809 solutions by brute force enumeration.  Also, it can be directly calculated this way: since the average is exactly 4, and the only possibilities are 3, 4, or 5, the possible solution classes are { no 3's or 5's, one 3 and one 5, two 3's and two 5's, ..., nine 3's and nine 5's }.  This can be calculated by nCr(18,0)*nCr(18,0) + nCr(18,1)*nCr(17,1) + nCr(18,2)*nCr(16,2) + ... + nCr(18,9)*nCr(9,9) = 44,152,809.  This means approximately 11.4% of all possible combinations are valid solutions (44,152,809 / 3^18).

sum(factorial(18)/factorial(x)/factorial(y)/factorial(z) for x in range(25) for y in range(25) for z in range(25) if 3*x+4*y+5*z == 72 and x+y+z == 18) gives 44152809L

k (18 17 16 chars)
Back to the original approach, credit to CS for the improvement.
(+/4-){3+18?3}/0

Other approach (17 chars), same method as the J solution, H/T to CS
4+a,-a:9?2 -18?18

Old version:
(72-+/){18?3+!3}/0

Not susceptible to stack-overflow and runs in fixed amount of space.

What's H/T to CS?

Hat-tip, http://en.wikipedia.org/wiki/Hat_tip#Metaphor

This program helped me discover a bug in my K interpreter- thanks! I didn't previously realize that nilads could be applied to a single argument (which they ignore).

K, 28
{$[72=+/s:18?3 4 5;s;.z.s`]}

J, 20 18 17 characters
(?~18){4+(,-)?9#2

This works in the same way as the previous answer except that the 9 random digits are either 0 or 1 and are negated before being appended. This means there are as many -1s as there are 1s. Adding 4 gives me a list of 3s, 4s and 5s that add up to 72 every time.
Previous answer:
({~?~@#)3+(,2-])?9#3

Generates the first 9 holes randomly ?9#3, then copies and inverts them (,2-]) (turns a 3 into a 5 and a 5 into a 3) to generate the final 9. This guarantees that the total will be 72 (since every 3 will have a matching 5 the average total per hole will be 4 and 4x18=72). It then randomly shuffles the result ({~?~@#) to ensure that every combination is possible.

actually you won't generate {3,5,4,4,4...} you are better off shuffling the entire result

@rachetfreak Good point. I'll edit now.

Mathematica 71 68 66 60
With 6 chars saved by Tally's suggestion.
RandomSample@RandomChoice@IntegerPartitions[72, {18}, {3, 4, 5}]

{5, 4, 3, 3, 5, 3, 5, 5, 3, 3, 4, 5, 3, 5, 4, 4, 5, 3}

All possible outcomes are possible, but they are not equally likely.

Analysis
IntegerPartitions[72, {18}, {3, 4, 5}]

produces all 10 possible partitions (combinations, not permutations) of 72 into 18 elements consisting of 3's, 4's and 5's.

RandomChoice selects one of those.
RandomSample returns a permutation of that choice.

Hehe, I was just about to post almost the exact same answer, only using RandomChoice instead of RandomInteger.
I think you can shave of 4 more characters by doing so.

Tally, thanks.  Your suggestion was helpful.

16-bit x86 machine code under MS-DOS - 45 bytes
Hexdump:
0E5F576A12595188ECE44088C3E44130D8240374F400C4AAE2EF595E80FC2475DFAC0432CD29B020CD29E2F5C3

Base64 coded binary:
Dl9XahJZUYjs5ECIw+RBMNgkA3T0AMSq4u9ZXoD8JHXfrAQyzSmwIM0p4vXD

Actual source code with some comments:
 bits 16
 org 0x100

again:
 push cs               ; Save whatever CS we get.
 pop di                ; Use CS:DI as our course buffer..
 push di               ; Save for later use in the print loop
 push 18               ; We need 18 holes for our golf course.
 pop cx                ; ch = 0, cl = 18.
 push cx               ; Save for later use.
 mov ah, ch            ; Zero out ah.
generate_course:
 in al, 0x40           ; Port 0x40 is the 8253 PIT Counter 0.
 mov bl, al            ; Save the first "random" value in bl.
 in al, 0x41           ; Port 0x41 is the 8253 PIT Counter 1.
 xor al, bl            ; Add some more pseudo randomness.
 and al, 3             ; We only need the two lower bits.
 jz generate_course    ; If zero, re-generate a value, since we need only 3, 4, 5 holes.
 add ah, al            ; Sum in ah register.
 stosb                 ; Store in the course buffer.
 loop generate_course  ; Loop for 18 holes.
 pop cx                ; cx = 18.
 pop si                ; si = course buffer.
 cmp ah, 36            ; 72 holes?
 jne again             ; No, re-generate the whole course.

print:                 ; Yup, we have a nice course.
 lodsb                 ; Load the next hole.
 add al, '2'           ; Add ASCII '2' to get '3', '4' or '5'
 int 0x29              ; Undocumented MS-DOS print function.
 mov al, ' '           ; Print a space too for better readability.
 int 0x29              ; Print the character.
 loop print            ; Print the whole course.
 ret                   ; Return to the beginning of the PSP where a INT 0x20 happen to be.

Compile with nasm 18h.asm -o 18h.com and run under MS-DOS (or Dosbox), or NTVDM from a 32-bit Windows version.
Sample output:
4 5 4 5 4 5 3 4 3 4 3 4 4 5 4 3 5 3

love assembler...

R - 41
x=0;while(sum(x)!=72)x=sample(3:5,18,T);x

# [1] 5 3 5 3 3 3 3 3 5 4 5 4 5 4 4 5 5 3

The algorithm is similar to @sgrieve's.

Same problem as @sgrieve above -- nothing prevents it from going over in 18 holes.

That's not a problem, the sample command in this case always generates 18 values.

JavaScript, 66 64 61 chars
Heavily inspired by TwoScoopsofPig (PHP) and Joe Tuskan (JS).

for(a=[s=0];s!=72;)for(s=i=0;i<18;s+=a[i++]=Math.random()*3+3|0);a

for(a=[s=0];s-72;)for(s=i=0;i<18;s+=a[i++]=Math.random()*3+3|0)a

for(a=s=[];s;)for(i=18,s=72;i;s-=a[--i]=Math.random()*3+3|0)a

s!=72 can be s-72 to save one char. And the last semi-colon ;a isn't needed either for another char.

i never saw for(i=x;i;i--) before it saves 2 chars from for(i=0;i<x;i++), thanks man!

GolfScript (26 chars)
{;0{3rand.3+@@+(}18*])}do`

There are some obvious similarities with Ilmari's solution, but also some obvious differences. In particular, I'm exploiting the fact that the average par is 4.

Damn, but that sure is a clever trick with the loop condition there.  I came up with  {;0{3.rand+.@+}18*])72-}do myself, but couldn't figure out how to get it any shorter from there. +1.

Python 77
Code
from numpy.random import*;l=[]
while sum(l)!=72:l=randint(3,6,18)
print l

Output
[3 4 4 5 3 3 3 5 4 4 5 4 5 3 4 4 5 4]

The import really kills this solution. It uses numpy to generate a 18 numbers between 3 and 5 and keeps generating lists until the sum of the list equals 72.

What prevents the program from reaching 72 well before generating 18 holes? What prevents it from skipping 72?

The code will always generate 18 holes, then check if the sum equals 72. For example, if the sum after 16 holes was 72, it would still generate another 2 holes, therby pushing the sum above 72 and failing the test.

GolfScript, 27 chars
{;18{3.rand+}*].{+}*72-}do`

Uses the same rejection sampling method as sgrieve's Python solution.  Thus, every valid output actually is equally likely.

Python 2, 70 bytes
from random import*
print sample(([3,5]*randint(0,9)+[4]*99)[:18],18)

edit:

Here's another one, similar to the solution of sgrieve:
Python 2, 73 bytes + equal probability
from random import*
a=[]
while sum(a)-72:a=sample([3,4,5]*18,18)
print a

Q (25 characters)
Original (27)
while[72<>sum a:18?3 4 5];a

Sample output
4 4 3 3 4 5 4 3 4 5 5 3 5 5 5 4 3 3

Slightly shorter (25)
{72<>sum x}{x:18?3 4 5}/0

Python, 128 120 116 characters
import random,itertools
random.choice([g for g in itertools.product(*(range(3,6)for l in range(18))) if sum(g)==72])

import statements are still length killers (23 characters only to import 2 function in the namespace)
i hope you do not need the result in a near future, as this code first evaluates all possible solutions before chosing one at random. maybe the slowest solution to this problem.
i do claim extra kudos for equal probability of each configuration...

import random,itertools

you are right, that shorten things a bit.

Other tips: import random as r,itertools as i then use r and i instead of random and itertools. Use 18*[0] instead of range(18), and [3,4,5,6] instead of range(3,6) :)

i am using python 3: a list comprehension is a generator and has no length, which forbids its use with the choice() function. that's also what makes this code so slow...

Ah, I'm using 2.7. I've added my attempt at golfing your answer in my Q here

Uh... in Python 3, list comprehensions produce lists and can be passed to random.choice. In fact, [genexpr] is syntactic sugar for list(genexpr).

ooops, sorry, i messed up list comprehension and generator expression (i generally avoid list comprehension in favor of generator expression because of the better performance of iterator). so indeed, even in python3 i can still remove some characters... @Alex did it right.

Ruby 1.9 (62 chars)
a=Array.new(18){[3,4,5].sample}until(a||[]).inject(:+)==72
p a

Rails (55 chars)
In the $ rails c REPL (in any Rails folder):
a=Array.new(18){[3,4,5].sample}until(a||[]).sum==72
p a

Note: It works with Ruby 1.8 if you use shuffle[0] instead of sample.

Do you need whitespace around until?

@Kaz You're right, it's not needed. :) 62 chars now.

You can use (1..18).map{rand(3)+3} to get the random array ;)

PHP - 77 Chars
<?while(array_sum($a)!=72){for($i=0;18>$i;){$a[++$i]=rand(3,5);}}print_r($a);

Much like sgrieve's solution, this builds a list of 18 holes, checks total par, and either prints it or rejects it and tries again. Oddly enough, our two solutions are the same length.
Rather annoyingly, PHP doesn't offer array functions with any brevity of name. Array_sum and print_r are killing me. Suggestions welcome.

Curly braces are not needed here, and sum can be +=. <?while($s!=72)for($s=$i=0;18>$i;$s+=$a[++$i]=rand(3,5));print_r($a);

That's useful - I never thought to put the logic in the for loop call (and I feel kinda dumb for not incrementing a counter for the sum).

Thanks – but that isn't actually what I meant by "curly braces not needed"; you could have removed them in the original code too: while(array_sum($a)!=72)for($i=0;18>$i;)$a[++$i]=rand(3,5);

Well except I run against a stricter php.ini than that because I'm golfing at work; it complains no end about braces being missing/mismatched. Normally I would have.

That's odd; 5.4.7 with E_ALL|E_STRICT never complains about missing {}'s (since PHP's syntax explicitly allows that).

I'm stuck on 5.3.2. So. That.

Lisp (78 69 chars)
(do((c()(mapcar(lambda(x)(+ 3(random 3)))(make-list 18))))((=(apply'+ c)72)c))
(do((c()(loop repeat 18 collect(+ 3(random 3)))))((=(apply'+ c)72)c))

It's rather similar to sgrieve's Python solution.
Start with c as NIL, check for a sum of 72, the do "increment function" for c generates a list of 18 numbers between 3 and 5, check for 72 again, lather, rinse, repeat.
It's refreshing to see do and loop nicely play golf together.

JavaScript, 116 99 65 bytes
for(i=0,h=[];i<18;)h[i++]=5;while(h.reduce(function(a,b){return a+b})!=72){i=Math.random()*18|0;h[i]=[3,4,4][i%3]}h;
h=[0];while(h.reduce(function(a,b){return a+b})-72)for(i=0;i<18;h[i++]=[3,4,5][Math.random()*3|0])h
while(i%18||(a=[i=s=0]),s+=a[i++]=Math.random()*3+3|0,s-72|i-18)a

When I run this in Chrome 21, I get i is not defined.

C (123 chars) - effort on efficiency
Pipe through wc and it will generate all 44152809 solutions within 10 seconds...
char s[19];g(d,t){int i;if(d--){for(i=51,t-=3;i<54;i++,t--)if(t>=3*d&&t<=5*d)s[d]=i,g(d,t);}else puts(s);}main(){g(18,72);}

Oh, well - didn't read the question properly - but given we're generating all solutions then picking a random one with equal probability is a scripting exercise :P

Clojure - 55
(shuffle(mapcat #([[4 4][3 5]%](rand-int 2))(range 9)))

Quite a fun trick.... exploits the mathematical structure of the problem that there must be exactly as many 3 par holes as 5 par holes.

Python 83
import random as r;x=[]
while sum(x)!=72:x=[r.randint(3,5) for i in 18*[0]]
print x

Like sgrieve's solution, but without numpy
Golfing Adrien Plisson's solution:
120->108 characters
import random as r,itertools as i
r.choice([g for g in i.product(*([3,4,5,6]for l in 18*[0]))if sum(g)==72])

MATLAB 53
x=[];
while sum(x)~=72
x=3+floor(rand(1,18)*3);
end
x

Output:

x =
       4     3     4     4     4     4     5     4     4     3     4     4     3     5     3     5     4     5

Nice approach, but you can save 4 bytes by typing randi([3,5],1,18) instead of 3+floor(rand(1,18)*3)

Java (61 chars)
while(s!=72)for(i=0,s=0;i<18;i++)s+=3+(int)(Math.random()*3);

Sample output:
5 4 3 4 5 3 4 4 3 5 4 4 4 4 3 4 4 5

I'm no Java expert, but shouldn't there be a declaration of s and i, and some kind of call to System#println(..)?

This is just a code snippet, not a program. And it actually looks very much like @JoeIbanez' C version.

CJam, 17 14 bytes
CJam is newer than this challenge, but this is not the shortest answer anyway, so that doesn't really matter.
Z5]Amr*I4e]mrp

Test it here.
To maintain the total of 72, each 3 must be paired with 5. So here is how it works:
Z5]            e# Push [3 5].
   Amr         e# Get a random number between 0 and 9.
      *        e# Repeat the [3 5] array that many times.
       I4e]    e# Pad the array to size 18 with 4s.
           mr  e# Shuffle the array.
             p e# Print it.

C (94 chars)
int h[18],s=0,i;
while(s!=72)for(i=s=0;i<18;s+=h[i++]=rand()%3+3);
while(i)printf("%d ",h[--i]);

The s=0 on line 1 may not be required, because what are the chances an uninitialized int will equal 72?  I just don't like reading uninitialized values in straight C.  Also, this probably requires seeding the rand() function.
output
3 3 3 4 5 5 3 3 4 5 5 4 3 4 5 5 5 3

So basically you're gonna loop through random strings of 18 numbers ranged 3 to 5 until one happens to equal 72? Good thing efficiency isn't a requisite.

@KeithS To be fair, that's what the majority of the answers to this question are doing.

TXR (99 chars)
@(bind g@(for((x(gen t(+ 3(rand 3))))y)(t)((pop x))(set y[x 0..18])(if(= [apply + y]72)(return y))))

This expression generates an infinite lazy list of random numbers from 3 to 5:
(gen t (+ 3(rand 3)))  ;; t means true: while t is true, generate.

The rest of the logic is a simple loop which checks whether the first 18 elements of this list add up to 72. If not, it pops an element off and tries again. The for loop contains an implicit block called nil and so (return ...) can be used to terminate the loop and return value.
Note that the 99 character length includes a terminating newline, which is required.

I put in a commit that allows the (t) to be replaced by (). :)

C# (143 non-whitespace):
()=>{
  var n=new Math.Random().Next(10);
  Enumerable.Range(1,18)
    .Select((x,i)=>i<n?3:i>=18-n?5:4)
    .OrderBy(x=>Guid.NewGuid())
    .ForEach(Console.Write);
}

new Guid() creates an empty GUID. To actually generate a unique GUID you need to call a static method Guid.NewGuid.

And you have two off-by-one errors (so to speak): the comparisons should be i=18-n, not the other way around. And you could reduce the size by using a constant 3 instead of x-1 and 5 instead of x+1. And then you could replace Enumerable.Repeat by Enumerable.Range.

Edited; still 143 chars

There is no Math.Random, it's System.Random.

Another C# approach (143 chars): var r=new Random();for(;;){var e=Enumerable.Range(1,18).Select(i=>r.Next(3,6)).ToList();if(e.Sum()==72){e.ForEach(i=>Console.Write(i));break;}}

Bash shell script (65 chars)
shuf -e `for x in {0..8}
do echo $((r=RANDOM%3+3)) $((8-r))
done`

(shuf comes from the GNU coreutils package. Also, thanks Gareth.)

Haskell, 104 102 98 chars.
import System.Random
q l|sum l==72=print l|1>0=main
main=mapM(\_->randomRIO(3::Int,5))[1..18]>>=q

[1..n]>>[r] is slightly shorter than replicate n$r.

Also changed sequence to mapM.

Perl, 74
{@c=map{3+int rand 3}(0)x18;$s=0;$s+=$_ for@c;redo unless$s==72}print"@c"

Alternative solution:
@q=((3,5)x($a=int rand 9),(4,4)x(9-$a));%t=map{(rand,$_)}(0..17);print"@q[@t{sort keys%t}]"

VBA - 117
VBA never wins at golf. :-)
Sub a()
Do Until d=72
d=0
c=""
For b=1 To 18
e=Int(3*Rnd()+3)
c=c &" " &e
d=d+e
Next
Loop
MsgBox c
End Sub

APL 12
4+{⍵,-⍵}?9⍴2

Note that I have the index origin set to 0, meaning arrays start at 0.  You can set this with ⎕IO←0.

The question asks a program that can produce every possible configuration. Yours can produce simmetric ones. You can't produce for example 555455555333333343, at least it seems so to me.

R, 42 bytes
a=0;while(sum(a)-72)a=sample(3:5,18,r=T);a

sample, by default, draws evenly among the possible values (here 3 4 5). r=T stands for replace=TRUE and allows sample with replacement.

Python, 97
Using a different method than the rejection sampling, this picks a random list of indices of random even length and alternates adding and subtracting to the elements at these indices.
from random import*;a=[4]*18;d=1
for i in sample(range(18),2*randint(0,9)):a[i]+=d;d=-d
print a

Clojure - 72 chars
(some #(if(=(apply +%)72)%)(partition 18(repeatedly #(+(rand-int 3)3))))
Would be much shorter if Clojure didn't have such flowery descriptive function names :-)

Groovy
126 chars

def a=[];while(1){(new Random().nextInt(3)!=1&&a.size()<17?a<<3<<5:a<<4);if(a.size()==18)break};Collections.shuffle(a);print a

... ooooh, what a waste of chars :)
110 chars
def a=[];while(a.size()<18){(new Random().next(2)>1&&a.size()<17?a<<3<<5:a<<4)};Collections.shuffle(a);print a

PowerShell - 59
while(($x|measure -s).sum-ne72){$x=1..18|%{3..5|random}};$x

Perl, 59
@a=map{3+rand 3|0}1..18 while 72!=eval join'+',@a;print"@a"

Not a winner by any means and could probably be improved still...
Array sum method stolen from perlmonks.

Mathematica, 45 chars
NestWhile[{3, 5}~RandomInteger~18 &, {}, Tr@# != 72 &]

Perl 6 (42 bytes)
my@a=roll 18,3..5 while 72!= [+] @a;say @a

Probably too long to be acceptable, but at least the solution does exist. roll rolls the dice containing 3, 4, and 5. This generates numbers until the sum is equal to 72. I believe it can generate any course with equal probability (in theory), but considering pseudo-random number generators, it probably doesn't.
Sample output:
~ $ perl6 -e 'my@a=roll 18,3..5 while 72!= [+] @a;say @a'
3 4 3 3 4 5 4 3 4 4 3 4 5 4 5 5 4 5

TI-BASIC, 13 bytes
3+3fPart(randIntNoRep(0,17)/3

Outputs list of 18 integers. Meets all specs and has equal probability for each case.

And yes, total is always 72 thanks to our handy 2-byte randIntNoRep(

This only produces lists with exactly 6 3's, 6 4's, and 6 5's.

"Each hole must have a length of 3, 4 or 5"

"Your program must be able to produce every possible hole configuration"-- so for example, 9 3s and 9 5s would be valid.

Pyth, 18 bytes
#Jm+3O3U18IqsJ72JB

How it works:
#                    infinite loop
       U18           generate the list [0, 1, ..., 17]
  m    U18           map every value of this list to
   +3O3              a random number between 3 and 5
 Jm+3O3U18           and assign the resulting list to J
          I          if
           qsJ72     the sum of J == 72
                J    print J
                 B   and exit the loop

CJam, 31
[Language was created after the question was posted]
Shamelessly long for CJam. It's basically a brute-force solution that keeps trying random configurations until it finds one that adds to 72.
L{;L{3mr3+_U+:U;a+}I*U72=:U!}g`

Java: 389 bytes
Run by calling the b() function.
import java.util.*;public class a{Random b=new Random();int[]b(){int[]c=new int[18];int d=0;for(int i=0;i<c.length;i++){int e=g(c.length-i,d);int f=h(c.length-i,d);c[i]=i(e,f);d=d+c[i];}
return c;}
int i(int j,int k){return b.nextInt((k-j)+1)+j;}
int g(int l,int m){int n=(l-1)*5;int o=72-m;int p=o-n;return p<3?3:p;}
int h(int q,int r){int s=(q-1)*3;int t=72-r;int u=t-s;return u>5?5:u;}}

whoever downvoted can explain?

Javascript, 148 143 bytes
t=[];d=0;while(d<18){q=t.reduce(function(a,b){return a+b},z=0);while(!z||q+z+13-d*5<0||q+z-d*3>21)z=3+3*Math.random()|0;t.push(z);d++}alert(t)

PARI/GP, 85 bytes
vecextract(Vec(partitions(72,[3,5],[18,18])[random(10)+1]),numtoperm(18,random(18!)))

This generates a random partition of 72 with 18 components ranging from 3 to 5. The probabilities are not uniform, from 1/10 for the all-4 vector to 1/171531360 for [3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5] and its permutations.

05AB1E, 16 bytes
[18Lε3LÌΩ}DO₆·Q#

Try it online!

3LÌ18ãʒO72Q}Ω (13 bytes) should work in theory, but obviously times out. But I like your current approach since it actually gives a result. :) You can save a byte by changing the 3LÌΩ to ƵõΩ. (Unfortunately žP has a length of 20 and žq/žr have a length of 17 instead of 18, otherwise the 18L could have been replaced as well.)

Vyxal, 14 bytes
{:ṁ4≠|18ƛ3 6r℅

Try it Online!
{              # While...
 :ṁ            # The mean of the current value
   4≠          # Isn't 4
     |         # Do...
      18ƛ      # Fill an array of 18 elements with...
         3 6r℅ # one of 3, 4, and 5.

Octave, 37 bytes
while sum(x=2+randi(3,1,18))-72;end;x

It seems straight forward, (and I guess it is), but there are a few nifty tricks in here. It's 16 bytes shorter than the MATLAB answer, and I think it's hard to golf any further.
In Octave, you can initialize a variable inside a function call, or inside the while statement as done here. So, by doing sum(x=2+randi(3,1,18)) I manage to continuously shuffle a vector of 18 elements with values [3,4,5] until the sum is 72. Instead of checking if this equals 72, we can subtract 72, and check if that's a truthy or a falsey value. Any non-zero values are considered truthy, so it will only stop when the sum is 72.
In the end, the loop stops and the vector is printed.

Seriously, 32 bytes (noncompeting)
35k9Ju;)@nktd9-τ4nktW;lJ`\`np@WX

This language post-dates this challenge. Posted to prove the need for a shuffle command and perhaps a cons command. This uses the same solution as CJam roughly:
35k                                 Push [5,3]
   9Ju                              Push a random number n from 1 to 9
      ;)                            Save a copy of it for later use.
        @n                          Make n copies of [5,3]
          (9-τ                      Transform n -> 2*(9-n)
              4n                    Push that many 4's
                kt                  Compile all numbers into a list.
                  W         W       Until the list is empty:
                   ;lJ`\`np@        Pop a random element from it.
                             X      Discard empty list.

AHK, 76 bytes
Loop{
s=
t=0
Loop,18{
Random,r,3,5
s:=r " "s
t+=r
}
If t=72
Break
}
Send,%s%

It's of the style to just loop forever until it happens to generate a list that totals 72 strokes.


text:
Quickly find length of n-th term of the look-and-say sequence
The look and say sequence is an example of a run length encoding sequence.  To get the next term of the sequence one groups the sequence into runs of the same number, each group in the next term then becomes two digits, first the number of terms in the group, followed by the value in the group.  The first term is 1.
Here is how we would calculate the first couple of terms by hand:

We start with 1, grouping that gives us [1] a single group of 1 1.  Thus our next term is 11.  We group this and get [11] a single group of 2 1s, so our next term is 21.  Grouping again we get [2],[1], we translate each of these groups into 2 digits each, 12,11 and concatenate, 1211.  Group again [1],[2],[11], then convert each group, 11,12,21 and concatenate, 111221.

The first couple terms of the sequence are:
1
11
21
1211
111221
312211
13112221
1113213211

Write a program that when given n as input returns the length of the nth term of this sequence as output.
Programs should have a runtime of O(n log n).
Answers will be scored in bytes with less bytes being better.

This is not like this.

I don't understand.

@flodel "One 1. Two 1(s). One 2, one 1. One 1, one 2, two 1(s)..."

@DavidCarraher But what does Numbers allowed mean?

Yes, I know what the look and say sequence is. I don't understand without calculating the terms (or am puzzled how it would be possible without it) and numbers allowed.

The sequence starting from 1 splits into the Conway elements Hf (11132) and Sn (13211) after seven iterations.  From than point onwards, it should be possible to calculate the length of the sequence by iterating the element decay matrix. The biggest difficulty in golfing this is going to be compressing the matrix.

@flodel I'm guessing that the poser meant that you can make numerical computations but cannot generate the LookAndSay output itself (nor use it internally). As for myself, I don't think it can be done.  But I could easily be wrong.

"Numbers allowed" is presumably because the "this" of "not like this" is a problem which explicitly disallows the use of any numerical character in the program.

http://oeis.org/A005341 mentions an order-71 recurrence. It's linear and its characteristic polynomial is given at http://en.wikipedia.org/wiki/Look-and-say_sequence , so there is a closed form in terms of 71 constants.

To avoid ambiguity about what "without calculating the terms" means, may I suggest requiring that valid entries must run in at most O(n log n) time with respect to the input n?  This should rule out any naive brute-force solution (which need exponential time and space), whereas I believe both r.e.s.'s solution and mine should pass.

I agree, will do.

GolfScript, 300 chars
~8-:m;'!5?HZi " A 9 "$??HLTZ^`eik 5Z`e <^ $k H ,Sds ?LT /5@MUav I " i ? "5i G  !#+.4;>@K]_cdhjy{| *HCRJD@:64122/42.,,*860-40-0.+9?B<862//?D<7=@:420-/5:60.-20.+./384/162.-HCRJD@:64122/42.,,*)! !""$&&('{32-}/]1,/~:&;:L;:T;]:S;0m>{&m=}{L,,{.49=\71=+}%:V{,(,{).V=\T?S={(V=+}/}%0+:V}m*,,0\{.V=\L=8-*+}/}if

Here's a slightly shorter entry.  Reads a number m from stdin, writes the length of the m-th term in the look-and-say sequence to stdout.
For example, input 50 produces output 894810, while input 1000 produces (after a few seconds):
21465050086246039983937316427688400486337379416867195943208935654503780844828013651860410256502890125611856727316762

I'll post a more detailed explanation of the code later, but basically this also works by repeatedly multiplying a vector with a sparse matrix, encoded as an ASCII string.  Some clever compression tricks, such as leaving out the all-ones superdiagonal of the matrix, are employed.
Ps. Here's a link to an online demo.  The server has been pretty slow lately, though, so if you see an error message about a timeout, try again (or just download the interpreter and run it yourself).

Addendum:  Here's the promised detailed explanation.  First, let me repost the code with whitespace and comments added:
# Parse input, subtract 8, save in variable m:
~ 8- :m;

# This long string encodes all the constants used by the program (I'll describe it below):
'!5?HZi " A 9 "$??HLTZ^`eik 5Z`e <^ $k H ,Sds ?LT /5@MUav I " i ? "5i G  !#+.4;>@K]_cdhjy{| *HCRJD@:64122/42.,,*860-40-0.+9?B<862//?D<7=@:420-/5:60.-20.+./384/162.-HCRJD@:64122/42.,,*)! !""$&&('

# Parse the data string:
# The data consists of several arrays of positive integers, encoded as printable ASCII
# characters and separated by spaces.  (Note that this means that the range of possible
# data values starts from 1, which requires some adjustment below.  Also, the values in
# L are actually shifted up by 8 to avoid having single quotes in the data string.)

{32-}/   # Subtract 32 (ASCII code of space) from each char and dump result on stack.
]        # Collect numbers from stack into an array.
1,/ ~    # Split array on zeros (formerly spaces) and dump pieces on stack.
:&;      # Save topmost piece (canned responses for inputs 1-7) in var &.
:L;      # Save second piece (element lengths) in var L.
:T;      # Save third piece (nonstandard decay targets) in var T.
]:S;     # Collect remaining pieces (nonstd decay sources) in array and save it in S.

# If m < 0, return a precomputed response from &, else run the indented code below:
0 m > { & m = } {
  # Set V to be the initial element abundance vector (1 Hf + 1 Sn):
  # (Note: both L and V have an extra sentinel 0 at the end to avoid overruns below.)
  L,, { . 49= \ 71= + } % :V
  # Update the element abundances m times:
  {
    # Run the following block for all numbers i from 0 to length(V)-2,
    # collecting the results in an array:
    ,(, {
      # Start with the abundance of element i+1 in V (all elements except H decay
      # downwards; the extra 0 at the end of V is needed to avoid a crash here):
      ).V=\
      # If this element is one of the decay targets listed in T, find the corresponding
      # list of source elements in S and add their abundances from V to the total:
      # (If this element is not in T, we just loop over an empty array at the end of S.)
      T? S= { ( V= + } /
    } %
    # Append a new sentinel 0 to the end of the array and save it as the new V:
    0+:V
  } m *
  # Multiply the element abundances from V with their lengths from L and sum them:
  ,,0\{.V=\L=8-*+}/
} if

The key fact that allows this code to work is that, as the look-and-say transformation is repeatedly applied to any string, it eventually splits into substrings which evolve independently, in the sense that we can obtain all the following elements of the look-and-say sequence starting from that string by taking each of the substrings, applying the look-and-say transformation to each of them independently n times and concatenating the results.
Furthermore, in his 1986 article "The Weird and Wonderful Chemistry of Audioactive Decay" (which basically introduced the look-and-say sequence to the world), John Conway proved a remarkable (and, for this challenge, crucial) result which he called the "cosmological theorem":

Cosmological theorem (Conway): There is a set of 92 finite strings of numbers 1–3 (which Conway named after the chemical elements; see table here), and two infinite families of strings each consisting of a fixed prefix followed by some number higher than 3 (these can only appear if the initial string contained number higher than 3 or sequences of more than 3 identical numbers), such that, after at most 24 applications of the look-and-say transformation, any string splits into a chain of such elements, each of which thereafter evolves independently (and splits into further elements).

Thus, to determine the length of a string sufficiently far in the look-and-say sequence, it's sufficient to know how many times each element appears in it.  And, since each element evolves independently, knowing these "elemental abundances" is also sufficient for calculating the corresponding abundances of the next string in the sequence, and so on.
As it happens, the look-and-say sequence starting from the string 1 splits into two Conway elements (Hf72 = 11132 and Sn50 = 13211) after just seven iterations.  Thus, thereafter, we only need to keep track of the abundances of the 92 "common" elements (as the two families of "transuranic" elements cannot arise from common elements).
Mathematically, we can treat the elemental abundances as a vector of length 92.  Calculating the abundances in the next step of the look-and-say sequence is then just equivalent to multiplying this vector with a 92 × 92 matrix, which is what r.e.s.'s solution does literally.
In fact, r.e.s.'s solution actually tracks the abundance of each element multiplied with its length (i.e. the "total mass" of that element in the string), adjusting the matrix accordingly, so that the total length of the string is given simply by adding the numbers in the abundance vector together.  However, I did not find that a particularly convenient representation for code golf.  (It was convenient for Nathaniel Johnston's derivation of Conway's polynomial, since it encodes the lengths into the matrix and thus gives the right eigenvalue for the asymptotic growth rate, but we don't care about that here.)
Instead, I just track the raw abundances of the elements, and only multiply them with the lengths at the end.  This has, combined with the convenient fact that none of the decay products of any element contain more than one copy of any element, means that the entries of the transition matrix are just zeros and ones.  Also, by far most of them are, in fact, zeros (in math jargon, the matrix is sparse), so I can save a lot of space by only storing the indices of those entries which are ones.
Also, in his article, Conway ordered the elements such that (except for H1 = 22, which is a fixed point of the look-and-say transformation), each element decays to the next lower element in the sequence (and possibly some others).
In fact, most elements decay only to the next lower elements.  Thus, by using Conway's ordering of the elements, I can hardcode this "standard decay" as part of the iteration, so that I only need to store the matrix entries corresponding to the other, "nonstandard" decays, saving even more space.
(In fact, what I actually do, for reasons mostly to do with how GolfScript's array operations work, is store one array listing the matrix rows containing non-zero entries (i.e. the elements which are produced in nonstandard decays) and another array of arrays listing, for each of these rows, the columns where the non-zero entries occur (i.e. the elements which produce these elements in such decays).  See the code and comments above for how these arrays are actually used to calculate the updated element abundances.)
The final space-saving trick I used was to encode all these arrays as strings of ASCII characters.  Conveniently, there are 95 printable ASCII characters from space (32) to ~ (126), and the largest value that appears in any of the arrays is 92, so they fit very well.  One extra tweak I made was to shift the values in the element length array (which only go up to 42 anyway) up by 8 so that I could avoid the character ' (39) and thus store my data in a single quoted string without having to add any backslash escape characters.
There are some other minor optimizations too, but those are just standard GolfScript coding tricks.  I should note that the actual code is not all that carefully optimized — it's quite possible that it could be golfed down further.
In any case, despite the inherent slowness of a double-interpreted language like GolfScript, the code runs quite fast and scales well: computing the length of the 10,000th string in the look-and-say sequence takes about 1.5 minutes on my computer.
Conveniently, GolfScript stores all numbers as arbitrary-length integers (bignums), so I didn't have to do anything special to make it produce exact results even for large inputs.
The expected time complexity of this program is O(n log n) (as the element abundances grow linearly with n, and bignum addition takes O(log n) time), and the actual runtime seems to fit that prediction pretty well, as the graph below shows:

(Time is in seconds; for what it's worth, the green curve is given by y = (a x log(b + x) + c) / x, where a = 0.00106462026133545, b = 2720.25843721031 and c = -0.0401630789530016.  The spike on the left mainly comes from the roughly constant runtimes for n < 8, which become relatively large when divided by small n.  I did not include it in the curve fit.)

Nice. Did you use the same logic as @r.e.s.?

The details are a bit different, but the basic idea of len = L * M^(n-8) * V is the same.

+1 for the excellent, brilliant explanation. I wish I could mark both of you right.

Couldn't you make it smaller by removing the canned responses for n = 1 to n = 7?

@Soham: I could, but I sort of assumed that I was required to provide the correct answer for any input, not just for inputs larger than 7.

Sage (18664 2021 1977)
This is a version that uses Nathaniel Johhnston's matrix formulation. (The matrix could probably be golfed further using eval.)
def f(n):
 z=[0];a=z*10;b=z*15;c=z*18;d=z*25;e=z*31;g=z*68;T=Matrix([z*28+[2]+z*63,e+[7/23]+z*60,z*29+[4/3]+z*62,z*30+[4/3]+z*61,z*32+[2]+z*59,z*53+[1/2]+z*38,z*36+[3/2]+z*55,z*37+[2]+z*54,z*38+[8/5]+z*53,z*39+[5/3]+z*52,z*43+[5/3]+z*48,z*45+[7/4]+z*46,z*46+[12/7]+z*45,z*47+[7/4]+z*44,z*48+[3/2]+z*43,z*50+[21/17]+z*41,z*51+[21/17]+z*40,z*49+[13/10]+z*42,z*44+[7/5]+z*47,z*52+[7/5]+z*39,z*40+[7/5]+z*51,z*41+[4/3]+z*50,z*42+[4/3]+z*49,z*34+[5/32,5/32]+z*56,z*56+[7/11,7/13,1/3,7/17]+z*32,z*54+[10/7]+z*37,z*55+[10/7]+z*36,z*33+[4/3]+z*58,b+[1/21,1/21,0,1/7]+z*12+[2/23,0,0,1/16,1/16]+z*17+[1/5,0,0,2/11,2/13,2/21,4/17]+z*21+[1/8]+z*3+[1/3]+z*6,z*17+[9/26]+g+[9/10]+z*5,z*87+[9/10]+z*4,z*19+[23/28]+z*72,z*34+[1/16,1/16]+d+[2]+z*19+[1/8]+a,z*88+[2]+z*3,z*90+[32/27,0],z*89+[32/27,0,0],z*91+[8/5],z*66+[3/7]+z*7+[1/3]+a+[1/2,3/10,3/10]+z*4,z*66+[5/7]+d,z*62+[3/2]+z*29,z*63+[10/7]+z*28,z*64+[9/7]+z*27,z*65+[9/7]+z*26,z*67+[3/2]+z*24,z*82+[5/3]+z*9,z*83+[8/5]+z*8,z*74+[7/9,7/12,7/12,7/16,7/18,7/24,7/23,7/16]+a,g+[4/3]+z*23,z*70+[6/5]+z*21,z*71+[5/4]+z*20,z*72+[17/14]+z*19,z*73+[17/14]+c,z*84+[4/3]+z*7,z*69+[5/4]+z*22,z*6+[7/12]+g+[7/12]+z*16,z*76+[7/12]+b,z*77+[11/16]+z*14,z*78+[13/18]+z*13,z*79+[7/8]+z*12,z*80+[17/23]+z*11,e+[2/23,0,0,1/16,1/16]+z*17+[1/5]+z*5+[2/17,1]+z*20+[1/8]+a,[0,1/7]+z*90,[1]+z*91,[0,1]+z*90,[0,0,7/6]+z*89,z*3+[7/6]+z*88,z*57+[7/13]+z*34,z*4+[1]+z*54+[4/17]+z*32,z*5+[6/5]+z*86,z*7+[4/3]+z*84,z*8+[5/4]+z*83,z*20+[8/7]+z*71,z*21+[7/6]+z*70,z*22+[7/6]+z*69,c+[9/14,9/28]+z*72,z*9+[6/5]+z*82,a+[6/5]+z*81,z*12+[4/3]+z*79,z*13+[9/7]+z*78,z*14+[4/3]+z*77,b+[23/42,23/42,23/26]+z*74,z*11+[8/7]+z*80,z*23+[6/5]+g,z*6+[5/12]+z*85,e+[15/23]+z*26+[5/7]+z*33,z*24+[6/7]+z*67,d+[1]+z*66,z*26+[1]+z*65,z*27+[3/8]+e+[3/17]+d+[1/2]+z*6,z*16+[9/14]+c+[27/32]+z*56,b+[9/14]+c+[27/32]+z*57,c+[5/14]+z*8+[5/8]+d+[1/2,0,0,5/11]+z*24+[5/16]+a]);v=vector(z*23+[5]+z*14+[5]+z*53);L=[1,2,2,4,6,6,8,10]
 if n<9:return L[n-1]
 Q=T
 for i in[1..n-9]:Q=Q*T
 return sum(Q*v)

E.g., [f(n) for n in [1..50]] produces
[1, 2, 2, 4, 6, 6, 8, 10, 14, 20, 26, 34, 46, 62, 78, 102, 134, 176, 226, 302, 408, 528, 678, 904, 1182, 1540, 2012, 2606, 3410, 4462, 5808, 7586, 9898, 12884, 16774, 21890, 28528, 37158, 48410, 63138, 82350, 107312, 139984, 182376, 237746, 310036, 403966, 526646, 686646, 894810]

Wow, that's probably the longest answer I've ever seen to a code golf challenge. :)

I agree. I'll test it out.

I thought at first that this was Golf. Python, hm.. nice answer. This matches the requirements.

Nice. And oh, this isn't Python?

@SohamChowdhury -- Sage has a "Python- based interface".


text:
Write all possible Braille characters
An interesting puzzle came to me looking at the elevator buttons this morning.
You are required to generate a list of all Braille patterns that fit in a 2x3 grid.  Use a hash # to denote a bump and a hyphen - to denote a flat area.
Expected output sample:
#-
--
--

##
--
--

#-
#-
--

(and so on...)

Rules:

Your program must separate each pattern by at least one character or line.
The patterns may be generated in any order.
All patterns, regardless of what the Braille alphabet actually uses, should be produced.  The completely blank pattern is optional.
Only unique bump patterns should be generated.  The following patterns are considered equivilent as the bumps are in an identical arangement.  In these cases, use the pattern that is closest to the top-left corner (ie. the first option in this example.)

#-  -#  --  --
#-  -#  #-  -#
--  --  #-  -#

Bonus points if you can make it work for any x by y sized grid. (EDIT: Within reasonable bounds.  Up to 4x4 is enough for proof of concept.)
Reading the wiki article, it appears there are 45 patterns (including the blank) that meet this puzzle's rules.

It's not quite counting, but it's very close. For x x y grids you generate the first 2^(xy) numbers and filter out those which mask to 0 against 2^x - 1 or (2^(xy+1) - 1)/(2^y - 1).

GolfScript, 34 32 chars
44,{84+2base(;{'-#'=}/@\n.}%2/n*

Turns out that there are shorter solutions than simply generating all 64 patterns and filtering out the bad ones.  In fact, by suitably mapping bits to grid positions, it's possible to map all valid (non-empty) patterns to a consecutive range of numbers, as this program does.
Specifically, the mapping I use is:
5 4
3 1
2 0

where the numbers denote the bit position (starting from the least significant bit 0) mapped to that position in the grid.  With this mapping, the valid grids correspond to the numbers 20 to 63 inclusive.
This is almost the same as the obvious mapping obtained by writing out the 6-bit number in binary and adding line breaks between every second bit, except that the bits 1 and 2 are swapped — and indeed, that's exactly how my program computes it.  (I also add 64 to the numbers before converting them to binary, and then strip the extra high bit off; that's just to zero-pad the numbers to 6 bits, since GolfScript's base would otherwise not return any leading zeros.)
Ps. Online demo here. (Server seems overloaded lately; if you get a timeout, try again or download the interpreter and test it locally.)
Edit: Managed to save two chars by avoiding unnecessary array building and dumping.  Phew!

Do you mind adding some details? I'm interested to see how you're defining this mapping.

@ardnew: Done, see above.

I think this is going to change a lot of people's answers.  :-)

Mathematica 97
Grid /@ Cases[(#~Partition~2 & /@ Tuples[{"#", "-"}, 6]), x_ /;
         x[[All, 1]] != {"-", "-", "-"} && x[[1]] != {"-", "-"}]

Blank is not included:
Length[%]

44

N.B. != is a single character in Mathematica.

C# – 205
class C{static void Main(){var s="---##-##";Action<int,int>W=(i,m)=>{Console.WriteLine(s.Substring((i>>m&3)*2,2));};for(int i=0;i<64;++i){if((i&3)>0&&(i&42)>0){W(i,0);W(i,2);W(i,4);Console.WriteLine();}}}}

Readable version:
class C
{
    static void Main()
    {
        var s = "---##-##"; // all two-bit combinations
        // a function to write one two-bit pattern (one line of a Braille character)
        Action<int,int> W = (i,m) => { Console.WriteLine(s.Substring(((i >> m) & 3) * 2, 2)); };
        // for all possible 6-bit combinations (all possible Braille characters)
        for(int i = 0; i < 64; ++i)
        {
            // filter out forbidden (non-unique) characters
            if ((i & 3) > 0 && (i & 42) > 0)
            {
                // write three rows of the Braille character and an empty line
                W(i,0);
                W(i,2);
                W(i,4);
                Console.WriteLine();
            }
        }
    }
}

Perl, 71 67 65 char
y/10/#-/,s/../$&
/g,/^#/m&&print
for map{sprintf"%06b
",$_}18..63

Convert int to binary, perform transliteration, and add a newline after every two chars.
The /^#/m test eliminates two patterns (20 and 21) that don't have a raised bump in the leftmost column.
General solution, 150 106 103 100 char
Read x and y from command line args. Newlines are significant
y/01/-#/,s/.{$x}/$&
/g,/^#/m*/^.*#/&&print
for map{sprintf"%0*b
",$x*$y,$_-1}1..1<<($y=pop)*($x=pop)

Iterate over 0..2xy like before, converting each int to binary,
substituting - and # for 0 and 1, and inserting a newline after
every $x characters.
/^#/m tests that there is a raised bump in the leftmost column, and
/^.*#/ tests that there is a raised bump in the top row. Only the
patterns that pass both tests are printed.

How does this account for the invalid combinations?

Because the loop excludes the patterns for 1..17, 20, and 21.

Python, 120 118 113 95 118
for j in range(256):
    if j/4&48and j/4&42:print''.join('_#'[int(c)]for c in bin(j/4)[2:].rjust(6,'0'))[j%4*2:j%4*2+2]

Edit: used Winston Ewert suggestion and added x by y grid solution
Edit: I somehow missed the last constraint about uniqueness. This script generates all the possible sequences, not just the 45.
Edit: Back up to 118 but now correct

Replace ['#','-'] with '#-'

J, 35 33 chars
3 2$"1'-#'{~(2 A.i.6){"1#:20+i.44

Uses the approach Ilmari Karonen came up with in their Golfscript solution.  However, since the J verb #: (antibase) stores the bits (or, well, digits in the generic case) in a list, we need to index it from the left instead of right (i.e. index 0 is the leftmost, highest bit).
The solution is rather straightforward: 20+i.44 gives a list of the numbers 20..63, inclusive.  #: takes the antibase-2 of each element in this list, and thus produces a list of bitpatterns for each number in that range.  { selects (basically reorders) the bits into the right pattern, and then { is used again in order to use the digits as indices in the string '-#' in order to prepare the output.  Finally, we arrange each entry into a 2-by-3 rectangle with $ (shape).

3 2$"1'-#'{~(2 A.i.6){"1#:20+i.44      N.B. use A. (anagram) to generate the right permutation

3 2$"1'-#'{~0 1 2 4 3 5{"1#:20+i.44

Does anyone know how something like (0 2 3 ,. 1 4 5) { #: 44 could be tweaked to work with a list of numbers rather than a single number?  Would probably shave off a few more chars.

Python - 121 112
blank is not included
from itertools import*
print'\n'.join('%s%s\n'*3%b for(b,n)in zip(product(*['_#']*6),range(64))if n&48and n&42)

you can trim that product up with '_#',repeat=6 -> *['_#']*6

@boothby: thanks. Also, b is already a tuple, so no need to convert it :)


text:
Score a game of Yahtzee
For each of the 13 rows of a Yahtzee scoresheet you are given (from stdin)
a space separated list of 5 numbers (dice).
Your task is to calculate the score for each line and output the Grand Total of the game.
Example
Input and how to interpret it:
Input       Box              Score
6 1 4 1 3   Aces              2
3 2 2 1 2   Twos              6
6 3 2 3 3   Threes            9
4 2 3 6 5   Fours             4
6 3 5 5 1   Fives            10
1 5 6 5 6   Sixes            12
            Bonus             -
4 2 4 4 1   3 of a kind      15
2 2 3 2 4   4 of a kind       -
3 2 2 2 3   Full house       25
1 3 1 6 1   Small straight    -
2 5 4 6 3   Large straight   40
2 2 2 2 2   Yahtzee          50
5 5 4 5 2   Chance           21
            Grand Total     194

We will disregard the Yahtzee Bonus and Joker rules, and only sum up the scores from the Upper and Lower Section and the Bonus in the Upper Section. If in doubt, refer to these rules.
May the shortest code win!

For the benefit of those who don't speak Norwegian, could you list the scoring rules you want people to implement directly in the question?

Heh heh ;) The rules are the same, it's only some of the blocks that have changed positions, and the addition of 1 and 2 pair. The first code-block is the rough translation (without "Sum" and "Bonus") so just refer to that one. The Norwegian link was just to justify the order of the blocks for people who may be used to other setups. I think the rules are clear, and that the "pair" blocks are pretty self-explanatory. The rest of the rules should be explained on the English wiki link I provided.

Oh, I just realized, the rules are different. I will use the official, "international" rules then: http://yahtzeerules.com/yahtzee-scoring.htm (I like the Norwegian ones better, it has more variations in possible scores) -- I'll change the question in a moment.

You are actually going to match the input cards to the scoring line?  Shouldn't we have to figure out which line is most appropriate for any given hand?

@DavidCarraher I thought about something like that, but then I think we are heading for something more of a code-challenge than a code-golf. Could be interesting though. Thanks for the edit btw ;)

Does a yahtzee count as a full house?

@Matt Based after skimming through some top results from a certain search engine, I'll say 'yes'.

 APL (124)
S←{⍺∊+⌿⍵∘.=⍵}⋄+/(+/⎕)(50×∧/,A∘.=A←⎕)(+/10×{⍵×∨/(⍳⍵)⍷1+A-⊃A←A[⍋A←⎕]}¨N)(25×∧/S∘⎕¨2 3)(+/{(+/A)×⍵S⊢A←⎕}¨N←3 4)(+/{+/⍵×⍵=⎕}¨⍳6)

I swear this looks identical to something I read on the side of an alien spaceship.

I have no idea if this program works or not, but surely it's the shortest :D

R - 264
S=sum;
P=prod;
T=function(i)table(x[i,]);
Z=function(i,...)any(sapply(list(...),function(y)all(y%in%x[i,])))
S((x[1:6,]==(R=row(x[1:6,])))*R)+ # Upper section
S(x[7,])*any(T(7)>2)+             # 3 of a kind
S(x[8,])*any(T(8)>3)+             # 4 of a kind
25*(P(T(9))%in%5:6)+              # Full house
30*Z(10,1:4,2:5,3:6)+             # Small straight
40*Z(11,1:5,2:6)+                 # Large straight
50*(P(T(12))==5)+                 # Yahtzee
S(x[13,])                         # Chance

(264 characters when excluding the comments)
With the input
x <- as.matrix(read.table("http://pastebin.com/raw.php?i=ZRMC9B4x"))

Output
[1] 194

Nice to see that someone manages to get the right output :D I'll update the example.

I think your program incorrectly handles full house. I tested dice 2 2 2 2 2 and I believe your program treats that as a full house and awards the 25 points.

I think there is also a problem with the large and small straights. If all dice are the same (I again tested 2 2 2 2 2) I get a result of numeric(0) instead of a score.

@Matt, where I come from (my rules or everyone's?) you can score a yahtzee (e.g. 2 2 2 2 2) under "Full house". I think you are correct about the straights, thanks; I will update my code with a shorter version I thought about.

Python 364
S=sum;R=range;D=[map(int,raw_input().split())for i in R(13)];s=S(x for i in R(6)for x in D[i]if x==i+1)
for i in R(2):d=D[6+i];s+=[0,S(d)][max(map(d.count,d))>2+i];d=sorted(set(D[9+i]));s+=[0,30+i*10]['1, 1, 1'+', 1'*i in`[d[x+1]-d[x]for x in R(len(d)-1)]`]
e=D[8];a=map(e.count,e);d=D[11];print s+S(D[12])+[0,50][d.count(d[0])==5]+[0,25][2in a and 3in a or 5in a]

As requested, input is on stdin:
$ yScore.py < dice.txt
194

If the data could be preloaded into a list, as some other solutions have done, I could remove 62 characters to get to 302.

Mathematica 359
y = IntegerDigits@ImportString[x, "Table"][[1]];
l = Length; g = Gather; r = Range; b = SortBy; h = l@b[g[y[[#]]], l][[-1]] &;
Tr@Flatten@{# Count[y[[#]], #] & /@ r@6, If[h@7 == 3, 15, 0],
If[h@8 == 4, 20, 0], If[(l /@ b[g[y[[9]]], l]) == {2, 3}, 25, 0],
If[MatchQ[Sort@y[[10]], {___, n_, m_, o_, q_, ___} /; m == n + 1 && o == m + 1 && q == o + 1], 30, 0],
If[Sort[y[[11]]] == r[y[[11, 1]], y[[11, 1]] + 4], 40, 0],
If[l@g[y[[12]]] == 1, 50, 0], y[[13]]}

There must be a more efficient way to check for the short straight.

GolfScript 180
n/{~]}%6,{)`['{''=},,''*']*}%[{.{+}*\{..|{'{'\'=},,'++1$\~}%$\;}:g~)\;2>*}{.{+}*\g)\;3>*}{g[2 3]=25*}{$:§;3,{).4+,\>§-}%1?)!!30*}{.$(\;.5+,\>\-!40*}{g)\;5=50*}{{+}*}]+]zip{~~}%{+}*

You can test the program here
Annotated program:
n/                          # split input by newline
{~]}%                       # parse an int array from each line

6,{)`['{''=},,''*']*}%      # create {X=},,X* code blocks,
                            # where X goes from 1 to 6
                            # (needed for processing the first
                            # half of the board)

[       # create an array of code blocks, for scoring:

        # three of a kind:
    {.{+}*\{..|{'{'\'=},,'++1$\~}%$\;}:g~)\;2>*}

        # four of a kind:
    {.{+}*\g)\;3>*}

        # full house:
    {g[2 3]=25*}

        # small straight:
    {$:§;3,{).4+,\>§-!}%1?)!!30*}

        # straight:
    {.$(\;.5+,\>\-!40*}

        # yahtzee:
    {g)\;5=50*}

        #chance:
    {{+}*}
]+              # concatenate the 1-6 code block array with this one

]zip            # distribute each line in the input
                # to the corresponding scoring rule (code block)

{~~}%           # evaluate each input/code pair
                # and get an array with score for each hand

{+}*            # sum up the partial scores.

Perl 527 characters
while(<>){$l++;$q=$c=0;$q=1if(($_=~/1/&&$_=~/2/&&$_=~/3/&&$_=~/4/)||($_=~/5/&&$_=~/2/&&$_=~/3/&&$_=~/4/)||($_=~/5/&&$_=~/6/&&$_=~/3/&&$_=~/4/));@a=split//;for(@a){$c++if/$l/;}$s+=$l*($c)if$l<7;$s+=35if$s>=63&&$l==6;for$i(1...6){$t=0;$f+=$c if($l==9&&($c==2||$c==3));$c=0if!($l==11&&$c>1);for(@a){$t+=$_;$c++if/$i/;}$s+=$t if($c>=3&&$l==7);$s+=$t if($c>=4&&$l==8);$s+=50if($c==5&&$l==12);$s+=$t if($l==13&&$i==6);}$s+=25if($f==5&&$l==9);$s+=30if($q==1&&$l==10);$s+=40if($c<2&&($t==15||$t==20)&&$l==11);exit(print $s)if($l==13);}


text:
given prime factors of a number, what is the fastest way to calculate it's proper divisors?
Given prime factors of a number, what is the fastest way to calculate divisors?
clc; clear;
sms=0;
count = 1;
x=0;
for i=11:28123
    fac = factor(i);
    sm = 1;
    for j = 1:length(fac)-1
        sm = sm + sum(prod(unique(combntns(fac,j), 'rows'),2));
    end
    if sm>i
        x(count) = i;
        count = count + 1;
    end
end
sum1=0;
count = 1;
for i=1:length(x)
    for j=i:length(x)
        smss = x(i) + x(j);
        if smss <= 28123
            sum1(count) = smss;
            count = count + 1;
        end
    end
end
sum1 = unique(sum1);
disp(28123*28124/2-sum(sum1));

currently I'm using this prod(unique(combntns(fac,j), 'rows'),2) code which is awfully slow and I'm using Matlab.

I don't know Matlab, but given factors a_0^k_0 * a_1^k_1 * ... * a_n^k_n, the sum of the proper divisors is given as (a_0^0 + a_0^1 + ... + a_0^k_0) * (a_1^0 + a_1^1 + ... + a_1^k_1) * ... * (a_n^0 + a_n^1 + ... + a_n^k_n), which should be a pretty fast formula to calculate manually.

Mathematica
Union[Prepend[Times @@@ Rest@Subsets@l, 1]]

Usage
I'm assuming that repeated factors would be repeated in the list of factors, as below:
l = {2, 2, 3, 5, 5, 11, 11, 11, 31, 37, 617};
Union[Prepend[Times @@@ Rest@Subsets@l, 1]]//AbsoluteTiming

This routine is much slower than the built in function Divisors, which has to first factor the Integer.  I am fairly certain that Divisors is compiled.
Divisors[282584210700]; // AbsoluteTiming

{0.000262, Null}

Haskell (with Data.List)
f :: [Int] -> [Int]
f [] = [1]
f (x:xs) = a ++ map (x*) a
    where a=f xs
factorsfromlist1 = nub . sort . f
-- may have better performance
factorsfromlist2 = map head . group . sort . f

On the list [2, 2, 3, 5, 5, 11, 11, 11, 17, 31, 37, 47, 67, 103, 331, 617, 1093, 1597, 2309]:
$ ghc -O test.hs
$ ./test
Prime factors of 2078661171193247994962581628700
Method 1: 1.077712s
Method 2: 0.863675s