That sounds quite easy to do in Python:
- Use the csv standard library to read/write from a spreadsheet (alternatively read an .xls or from Google Docs to maintain formatting, there's an API for that). Read the spreadsheet to an array of slots, where each slot is an array of card names..
-
Code:
import csv with open('polycube.csv', 'rb') as csvfile: pool = [row for row in csv.reader(csvfile)]
- Generate the next drafts pool by selecting a random card for each slot.
Code:
import random next_draft_list = [random.choice(slot) for slot in pool]
- To find the swaps:
Code:
from collections import Counters previous_draft = Counters(previous_draft_list) next_draft = Counter(next_draft_list) cards_to_remove = previous_draft - next_draft cards_to_add = next_draft - previous_draft print 'Cards to remove: %s' % cards_to_remove print 'Cards to add: %s' % cards_to_add
- previous_draft_list will need to be saved and loaded, you can save to a csv too for consistency or use pickle.