Code golf challenge: XKCD 936 passwords

Chris Angelico rosuav at gmail.com
Tue Oct 8 22:10:02 EDT 2013


On Wed, Oct 9, 2013 at 12:38 PM, Roy Smith <roy at panix.com> wrote:
> If you're willing to accept a sub-optimal random number generator:
>
> # Python-2, sorry
> import os
> print list(set(open('/usr/share/dict/words')))[os.getpid():][:4]

So that steps by your pid? That's going to drastically reduce the
entropy in the result, which is kinda the point of XKCD 936. I'll call
that one dubious... though it's still better than Rob's entry. (But
thanks Rob, I do like that one :) )

ChrisA



More information about the Python-list mailing list