Skip to content
A tool that applies genetic algorithms to building Magic: The Gathering decks.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
data_builders
deck_builder
.gitignore Massive reorganization of everything into something much neater Feb 23, 2019
README.md
run.sh

README.md

Using this repo

  1. Install build tools (if necessary!)

    xcode-select --install
    sudo easy_install pip
    brew install conan
    conan remote add vthiery https://api.bintray.com/conan/vthiery/conan-packages

pip install virtualenv virtualenv --python=python3 venv source venv/bin/activate ```

  1. Download MtG card data

    ./run.sh
  2. Put your collection of cards as a JSON file in data/collection.json as an object with card names as keys, and the quantity you own as the values. For example, if you own four Walking Balistas:

    {
      "Walking Ballista": 4
    }
    

    Be sure to use canonical card names, as reported on Gatherer or Scryfall. Split cards and two-sided cards will be formatted like "Driven // Despair" (Notice the spaces around the double-slashes).

    If you use MTG Manager on iOS, there is a script in data_builders/collection/mtg_manager_csv_to_json.py that will convert collections exported from MTG Manager to the required format

  3. Build genetic algorithm

    cd ../deck_builder
    conan install .
    cmake .
    cmake --build .
  4. Run the genetic algorithm

     ./bin/magique ../data collection.json
  5. Deactivate virtual environment

    deactivate

Thanks

You can’t perform that action at this time.