Dominion Strategy Forum

Dominion => Dominion General Discussion => Topic started by: Schneau on August 23, 2013, 11:54:07 am

Title: The Dominion Card Sorter
Post by: Schneau on August 23, 2013, 11:54:07 am
Would you like to order some Dominion cards, either for something like Qvist's rankings (http://forum.dominionstrategy.com/index.php?topic=6060.0) or Wandering Winder's Power Rankings (http://forum.dominionstrategy.com/index.php?topic=8693.0), without having to do it all by hand? If so, I have a Python program for you!

The Dominion Card Sorter (https://github.com/thelmuth/DominionCardSorter) is a program I wrote to help me sort things for Qvist's lists. Around last time that was happening, I published the program and a few people used it. Since then, I've cleaned it up and added some other related utility programs. All of them are open source - feel free to use it or edit it as you like! Here's the description I put in the readme:

DominionCardSorter.py
This is the main utility. You can use it to sort different lists of Dominion cards, such as $4 cards, Potion cost cards, Knights, and Ruins. Use it from command line with python DominionCardSorter.py.

ExpansionsByRanking.py
This program takes a list of all the cards that you have sorted into some sort of order, with better (or more favorite) cards coming earlier. It then prints the expansions sorted by the average ranks of the cards in each expansion. For example, to print the expansions using Wandering Winder's Power Rankings 2, you can type python ExpansionsByRanking.py CardLists/WWPowerRankings2.txt. This will tell you which expansions WW thinks are strongest, and gives this output (lower=better):
Code: [Select]
Cornucopia  75.3
Hinterlands 88.8
Dark Ages   99.2
Guilds      99.2
Prosperity  103.1
Intrigue    104.0
Seaside     107.5
Alchemy     117.7
Base        121.1
Promo       131.2

RankingsInExpansion.py
This program is similar to ExpansionsByRanking.py. It takes a list of all the cards sorted into an order. It then asks which expansion you are interested in, and prints all of the cards from that expansion along with their ranks in your list. For example, if you want to use Wandering Winder's Power Rankings 2, you can type python RankingsInExpansion.py CardLists/WWPowerRankings2.txt.