Did it in Brainfuck! I had a bit of trouble generating random numbers. I hoped something simple like a LFSR could give me a fairly decent looking sequence, but I found it looped too quickly and gave boring output. I resorted to using a RNG found here, which actually takes quite a long time to run. Since BF has no capacity to get any source of entropy from the operating system, I first have the user input any text (I pound on they keyboard) to seed the RNG. After that it takes the number of lines and outputs random BF, using 16 hard-coded subsequences.
get random seed input till newline (10)
>>>+[,[<+>>+>>>>>>+++<<<<<<<-]>[<+>-]<----------]
get number of lines
<<<,[->>
Map: n nesting seed lineCount _ _ _ _ _ _ randh randl
mod by 32 to get char count for this line
[>+>+<<-]>>[<<+>>-]>++++[<++++++++>-]<<
[->-[>+>>]>[+[-<+>]>+>>]<<<<<] >[-]>>[-]<[<<+>>-]
loop that many times
<<[-<
generate next 'random' number
>>[-]>[-]>[-]>[-]>[-]>[-]>[<<<<<<+>>>>>>-]>[<<<<<<+>>>>>>-]<<<<+++++++
[<+++++++++++>-]<[<<[>>>>>>+<<<+<<<-]>>>[<<<+>>>-]<<[>>>>>+<<<+>+<<<-]
>>>[<<<+>>>-]<[>>>>+[<<<+>+>>-]<<[>>+<<-]+<[>-<[-]]>[>+<-]<<-]<-]+++++
+[>++++++++<-]>-[<<[>>>>>+<<<<+<-]>[<+>-]>-]<<<[-]>[-]+++++[<+++++>-]<
[>>>>>>>+[<<<<<<+>+>>>>>-]<<<<<[>>>>>+<<<<<-]+<[>-<[-]]>[>>>>+<<<<-]<<
-]++++++[>>>>>>+++++++++<<<<<<-]>>>>>>[<<<<<<<<+>>+>>>>>>-]<<<<<<[>>>>
>>+<<<<<<-]<<
seed is now next number in sequence
copy and mod 16
[>>+>+<<<-]>>>[<<<+>>>-]>++++[<++++>-]<<
[->-[>+>>]>[+[-<+>]>+>>]<<<<<]>[-]>>[-]<
now we have bottom 4 bits of data; pick an output sequence:
#00: +
[<+<+>>-]<[>+<-]+<[>-<[-]]>[-[-]>[-]<
>++++++[<+++++++>-]<+.[-]]>
#01: +
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-[-]>[-]<
>++++++[<+++++++>-]<+.[-]]>
#02: -
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-
[-]>[-]<
>+++++[<+++++++++>-]<.[-]]>
#03: [->-[>+>>]>[+[-<+>]>+>>]<<<<<]
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-[-]>[-]<
>+++++++[<+++++++++++++>-]<.
>+++++[<--------->-]<-.
+++++++++++++++++.
-----------------.
>+++++[<+++++++++>-]<+.
>++++[<------->-]<-.
>+++[<------>-]<-.
>+++[<++++++>-]<+..
>+++++[<++++++>-]<+.
>+++++[<------>-]<-.
>++++[<+++++++>-]<+.
>++++++[<-------->-]<.
>++++++[<++++++++>-]<.
>+++++[<--------->-]<-.
+++++++++++++++.
-----------------.
>+++[<++++++>-]<+.
>+++++[<++++++>-]<+.
>+++++[<------>-]<-.
>+++[<------>-]<-.
>+++[<++++++>-]<+..
>+++++[<++++++>-]<+.
>++++[<-------->-]<-.....>++++[<++++++++>-]<+.[-]]>
#04: <
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-
[-]>[-]<
>++++++[<++++++++++>-]<.[-]]>
#05: <
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-
[-]>[-]<
>++++++[<++++++++++>-]<.[-]]>
#06: >
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[- ----[>+<----]>---.[-]<]>
#07: x y z
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-[-]>[-]<
>++++[<++++++++>-]<.
>++++++++[<+++++++++++>-]<.
>++++++++[<----------->-]<.
>++++++++[<+++++++++++>-]<+.
>++++++++[<----------->-]<-.
>+++++++++[<++++++++++>-]<.[-]]>
#08: [
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-
[-]>[-]<
>+++++++[<+++++++++++++>-]<.[-]<<<<+>>>>
]>
#09: [
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-
[-]>[-]<
>+++++++[<+++++++++++++>-]<.[-]<<<<+>>>>
]>
#10: ++[>+<------]>
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-
[-]>[-]<
>++++++[<+++++++>-]<+..
>++++++[<++++++++>-]<.
>++++[<------->-]<-.
>+++[<------>-]<-.+++++++++++++++++.
---------------......>++++++[<++++++++>-]<.
>+++++[<------>-]<-.[-]]>
#11: +<->++
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[- [-]>[-]<
>++++++[<+++++++>-]<+.
+++++++++++++++++.
---------------.
+++++++++++++++++.
>+++[<------>-]<-..[-]]>
#12: .
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-[-]>[-]<
>+++++[<+++++++++>-]<+.[-]]>
#13: ,
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-[-]>[-]<
>++++[<+++++++++++>-]<.
[-]]>
#14: [<+<+>>-]
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-
[-]>[-]<
>+++++++[<+++++++++++++>-]<.
>+++++[<------>-]<-.
-----------------.
+++++++++++++++++.
-----------------.
>+++[<++++++>-]<+..-----------------.
>++++++[<++++++++>-]<.[-]]>
#15: [-]
-[<+<+>>-]<[>+<-]+<[>-<[-]]>[-[-]>[-]<
>+++++++[<+++++++++++++>-]<.
>+++++[<--------->-]<-.
>++++++[<++++++++>-]<.[-]]>
[-]<<<
]
>+++++++[<+++++++++++++>-]<++<<[>>.<<-]>>[-]<<++++++++++.[-]<
]
Output for input
qqq
10
is
[<+<+>>-]<[-] x y z.< x y z<.++[>+<------]>[[-]+<. x y z++[>+<------]>.+<->++[->-[>+>>]>[+[-<+>]>+>>]<<<<<][+[<+<+>>-] x y z[<+<+>>-][<+<+>>-][<+<+>>-]++[>+<------]>+<->++]]
-[->-[>+>>]>[+[-<+>]>+>>]<<<<<][<+<+>>-][-][ x y z++[>+<------]>,[-][->-[>+>>]>[+[-<+>]>+>>]<<<<<]-]
<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]
+,++[>+<------]>-[[-]+<->++[[->-[>+>>]>[+[-<+>]>+>>]<<<<<],++[>+<------]>[->-[>+>>]>[+[-<+>]>+>>]<<<<<]++[>+<------]>.[+ x y z+<]]]
++[>+<------]>++-[-]-[-]+,[->-[>+>>]>[+[-<+>]>+>>]<<<<<][->-[>+>>]>[+[-<+>]>+>>]<<<<<][->-[>+>>]>[+[-<+>]>+>>]<<<<<]+,+[<++[>+<------]>,-+<->++]
-[<+<+>>-]-., x y z[ x y z<[<+<+>>-]< x y z<[+<->+++<->++-++[>+<------]>+<->+++[[<-[-][+<->++]]]]]
[<+<+>>-]++[<+<+>>-]-<<[-]+<->++<[]
,[->-[>+>>]>[+[-<+>]>+>>]<<<<<]++[>+<------]>++<->+++<->++[<+<+>>-]<
++[>+<------]>[<+<+>>-][+<->+++<->++[[->-[>+>>]>[+[-<+>]>+>>]<<<<<]<[<+<+>>-]++[>+<------]> x y z x y z<..[[-][<+<+>>-],[<+<+>>-]+,]]]
-, x y z<<[<[->-[>+>>]>[+[-<+>]>+>>]<<<<<].[,<-]]
and it runs in about 2 minutes on my box. Output contains entirety of BF syntax, including comments, and it well formed.
possible duplicate of Generate a random program in your favorite language
– user unknown – 2012-04-03T14:11:06.163If you were to assign a point value to each of the requirements you'd have something rather more like the "objective winning criteria" required. Without that the issue of duplication is moot. Question for the crowd does [code-golf]/not [code-golf] constitute a sufficient distinction to avoid closing? – dmckee --- ex-moderator kitten – 2012-04-03T15:15:27.517
Good point, and thanks for the link. I'll improve the question to include a scoring system tomorrow morning (it's 2am now). – Alex L – 2012-04-03T17:47:40.423
2This seems different than the linked question to me because of the same language restriction. Should cut down on the x->BF entries, although I will be working on BF->BF – captncraig – 2012-04-03T18:08:50.990
@dmckee I've modified the challenge, and anxiously await everyone's entries! I plan to add a bounty and my own entry to increase the appeal. – Alex L – 2012-04-04T09:44:24.370
3As far as I am concerned "most votes" is not, has never been and will never be an "objective criteria". It is quantitatively different from "fewest bytes" which can be determined from the entries themselves. – dmckee --- ex-moderator kitten – 2012-04-04T14:20:48.020
1What's the point of "must not be the same each execution (for the same n parameter) "? Wouldn't a strictly deterministic generation be more Lorem-Ipsum-like? – ceased to turn counterclockwis – 2012-04-05T11:31:28.277