Login Register






[challenge] Random string generator filter_list
Author
Message
[challenge] Random string generator #1
I don't know why, the only challenges I can come up with have something to do with generation..

Anyway, the challenge here is to generate a handful of random strings, separated by a newline (\n).

Rules:
-As usual, no bullshit imports
-Maximum 2 loops can be used
-Refactor to be as small as possible
-If the final product is 3 lines or under, I'll give you 10 NSP (it's pretty easy)

Sample output:
Code:
AA7XM1Dy RiC6Q IQKkcR XQI CdFU hrvz aK7z7o gqC 6m9 o0SAq 3zi7 Rf5ZhpL 95 Y lW MAUoqfW

Spoiler: My Solution (Ruby):
2 lines, told you it was easy.
Code:
chars = [("a".."z").to_a,("A".."Z").to_a,("0".."9").to_a].flatten 16.times { (1..9).to_a.sample.times { print chars.sample }; puts "\n" }
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: [challenge] Random string generator #2
You never said no bash commands. Fuck your challenge nigga.
Code:
od --string /dev/urandom

Where's my 10 NSP at?
XMPP - wrath@xmpp.jp

Reply

RE: [challenge] Random string generator #3
(06-01-2015, 04:51 AM)nothing.nobody Wrote: You never said no bash commands.

that's just common sense.. It's a programming challenge, not a "let's dick around with our terminal" session.

In addition, this breaks the rules. Correct me if I'm wrong, but calling /dev/urandom is importing something, thus, breaking the rule of "no bullshit imports"
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: [challenge] Random string generator #4
(06-01-2015, 04:52 AM)Touka Wrote: that's just common sense.. It's a programming challenge, not a "let's dick around with our terminal" session.
(06-01-2015, 03:08 AM)Touka Wrote: Anyway, the challenge here is to generate a handful of random strings, separated by a newline (\n).

That command does exactly what the challenge states to do, does it not? If not, I can just make it into a program instead.

lol.sh:
Code:
od --string /dev/urandom
(This post was last modified: 06-01-2015, 05:03 AM by Crypt.)
XMPP - wrath@xmpp.jp

Reply