Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (12 sloc) 274 Bytes
#!/usr/bin/env python3
# based on Fisher-Yates shuffle
# license: WTFPL
import fileinput
import random
import sys
choice = None
for n, line in enumerate(fileinput.input()):
if not random.randrange(n + 1):
choice = line
if choice is not None:
sys.stdout.write(choice)