Skip to content

Instantly share code, notes, and snippets.

@thelmuth
Created June 27, 2012 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thelmuth/3004244 to your computer and use it in GitHub Desktop.
Save thelmuth/3004244 to your computer and use it in GitHub Desktop.
Dominion Favorite Card Sorter
import random
#f = open("DominionCardList.txt")
#cards = []
#for line in f:
# cards.append(line[:-1])
cards = ['Cellar', 'Chapel', 'Moat', 'Courtyard', 'Pawn', 'Secret Chamber', 'Embargo', 'Haven', 'Lighthouse', 'Native Village', 'Pearl Diver', 'Herbalist', 'Hamlet', 'Crossroads', 'Duchess', "Fool's Gold", 'Chancellor', 'Village', 'Woodcutter', 'Workshop', 'Great Hall', 'Masquerade', 'Shanty Town', 'Steward', 'Swindler', 'Wishing Well', 'Ambassador', 'Fishing Village', 'Lookout', 'Smugglers', 'Warehouse', 'Loan', 'Trade Route', 'Watchtower', 'Fortune Teller', 'Menagerie', 'Develop', 'Oasis', 'Oracle', 'Scheme', 'Tunnel', 'Black Market', 'Bureaucrat', 'Feast', 'Gardens', 'Militia', 'Moneylender', 'Remodel', 'Smithy', 'Spy', 'Thief', 'Throne Room', 'Baron', 'Bridge', 'Conspirator', 'Coppersmith', 'Ironworks', 'Mining Village', 'Scout', 'Caravan', 'Cutpurse', 'Island', 'Navigator', 'Pirate Ship', 'Salvager', 'Sea Hag', 'Treasure Map', 'Bishop', 'Monument', 'Quarry', 'Talisman', "Worker's Village", 'Farming Village', 'Horse Traders', 'Remake', 'Tournament', 'Young Witch', 'Jack of all Trades', 'Noble Brigand', 'Nomad Camp', 'Silk Road', 'Spice Merchant', 'Trader', 'Envoy', 'Walled Village', 'Council Room', 'Festival', 'Laboratory', 'Library', 'Market', 'Mine', 'Witch', 'Duke', 'Minion', 'Saboteur', 'Torturer', 'Trading Post', 'Tribute', 'Upgrade', 'Bazaar', 'Explorer', 'Ghost Ship', 'Merchant Ship', 'Outpost', 'Tactician', 'Treasury', 'Wharf', 'Apprentice', 'City', 'Contraband', 'Counting House', 'Mint', 'Mountebank', 'Rabble', 'Royal Seal', 'Vault', 'Venture', 'Harvest', 'Horn of Plenty', 'Hunting Party', 'Jester', 'Cache', 'Cartographer', 'Embassy', 'Haggler', 'Highway', 'Ill-Gotten Gains', 'Inn', 'Mandarin', 'Margrave', 'Stables', 'Governor', 'Stash', 'Adventurer', 'Harem', 'Nobles', 'Goons', 'Grand Market', 'Hoard', 'Fairgrounds', 'Border Village', 'Farmland', 'Bank', 'Expand', 'Forge', "King's Court", 'Peddler', 'Transmute', 'Vineyard', 'Apothecary', 'Scrying Pool', 'University', 'Alchemist', 'Familiar', "Philosopher's Stone", 'Golem', 'Possession']
random.shuffle(cards)
# Comparator
def human_card_comparator(card1, card2):
print "If you like %s better, type 1." % card1
print "If you like %s better, type 2." % card2
choice = 'a'
while choice != '1' and choice != '2':
choice = raw_input("Choice: ")
if choice == '1':
return -1
else:
return 1
cards.sort(human_card_comparator)
print
for card in cards:
print card
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment