Last active
December 18, 2017 23:48
-
-
Save docmarionum1/ce6c10c75c521cfec36c5fe86e2b6f64 to your computer and use it in GitHub Desktop.
Codenames Blog
This file contains hidden or 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
**.bin | |
.ipynb_checkpoints |
This file contains hidden or 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
<> |
This file contains hidden or 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
import random | |
def get_board(): | |
cards = [] | |
with open('../codenames_cards.txt', 'r') as f: | |
for r in f.readlines(): | |
cards.append(r.lower().strip().replace(' ', '_')) | |
sample = random.sample(cards, 18) | |
return { | |
'positive': sample[:9], | |
'negative': sample[9:-1], | |
'assassin': sample[-1] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment