Created
November 13, 2016 16:22
-
-
Save markdcummings/22a171ef19072d9b156a0782c35cf453 to your computer and use it in GitHub Desktop.
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
import random | |
players = ['Garry', 'Joanna', 'Sara', 'Mark', 'Phil', 'Tom'] | |
houses = ['Stark', 'Greyjoy', 'Dorne', 'Tyrell', 'Lannister', 'Baratheon'] | |
drawing = range(0, len(houses)) | |
random.shuffle(drawing) | |
chosen_families = {p: houses[drawing[i]] for (i, p) in enumerate(players)} | |
for player, house in chosen_families.items(): | |
print('%(player)s is assigned house %(house)s' % | |
{'player': player, 'house': house}) |
Author
markdcummings
commented
Nov 13, 2016
Actually this is too complicated, here's a better version:
https://gist.github.com/codeweevil/1b1c7408a76b896492b5fcb432dcb8e8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment