Generate a random program in your favorite language
Python → Brainf*ck (185 223 233 255 285 287 303 characters)

Code

import random as r,sys
r.seed(int(sys.argv[1]))
c=list('&lt;&gt;.,+-')+['']
n=9/r.random()
def b():
 global n
 s=''
 while n&gt;0:n-=1;o=r.choice(c);s+=o if o else'[%s]'%b()
 return s
print b()



303 → 287 Characters: Removed math.ceil (it's not really necessary).
287 → 285 Characters: Switched to an empty string to denote the branch operator.
285 → 255 Characters: Condensed the if statement in the while loop.
255 → 233 Characters: Implemented JBernardo's suggestions from the comments.
233 → 223 Characters: Implemented tjko's suggestion from the comments.
223 → 185 Characters: Implemented some whitespace reduction suggestions from the comments.


Examples

$ python generate.py 1
--&gt;,,+-&lt;&lt;-,-&lt;,-&gt;[[&lt;&lt;,[.&gt;.&lt;&gt;,,&gt;&gt;&gt;,.&lt;-,+&gt;[[&lt;.-+[.-+.+[-,+&lt;&gt;-.&gt;,++.,,-,.,&lt;&lt;+[+]]]]]]]]
$ python generate.py 2
[&lt;&lt;--+.+++&gt;]
$ python generate.py 3
,.++&lt;&lt;-&gt;&gt;[,-,+&gt;+[,-+&lt;-+.&lt;[,-[+[.-,[[&lt;&lt;&gt;[,+.]]]]]]]]


Actually figuring out what the resulting BF programs do is left as an exercise to the reader.