Precomputing a series of 5 As and 5 Bs in a secret random order.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# python rands.py | |
# | |
# head -n 1 output | |
# head -n 2 output | |
# etc... | |
import random | |
f = open('output', 'w') | |
lst = [0]*5 + [1]*5 | |
for i in range(10): | |
idx = random.randint(0, len(lst)-1) | |
f.write(str(lst[idx]) + '\n') | |
del lst[idx] | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment