# Kingdom generator

When using the extension each time the game tries to pick a random kingdom set (in unranked and casual modes) a popup appears. You can use it to modify the method used to generate the kingdom. While the user interface is minimal, it allows for quite powerful customization. Of course you are still limited to the cards you purchased. First some examples:

**All**- use all the cards**Cellar, Market, Militia, Mine, Moat, Remodel, Smithy, Village, Woodcutter, Workshop**- any specific kingdom**Dark Ages**- use only Dark Ages cards**Dark Ages + Base Set**- use only Dark Ages and base Dominion cards**2 * Dark Ages + Base Set**- as above, but cards from Dark Ages are twice as more likely to be chosen**6 Seaside, 4 Base Set**- 6 cards from Seaside, others from the base set**All / Alchemy**- all but Alchemy cards**Moat, 3 Attack, All**- include Moat and at least 3 attack cards**Moat, 3 Attack, All / Attack**- include Moat and exactly 3 attack cards**3 (Seaside + Intrigue) * Victory, Seaside + Intrigue**- only Seaside and Intrigue, at least 3 victory cards

## How this really works

The expression given to the generator must define 10 sets (11 if Young Witch can be selected) of cards separated by commas. The simplest set specification is**All**, use all the cards available. So the full kingdom may look like this:

All, All, All, All, All, All, All, All, All, All, AllHowever, you can precede any set specification with a number to use if multiple times. So the above shortens to:

11 AllOn top of that, if you specify less than 11 sets, the last set will be used for the missing ones. That gives even shorter equivalent of the above:

AllHaving all 11 sets the generator picks one card of each set starting from the first set. Cards not available or already picked are excluded (so if some of the sets are smaller than 11 cards, the generator may fail). The 11th card is only picked when Young Witch was among the first 10 selected.

### Basic sets

There are couple of types of basic sets that can be used by name:- Direct card names for example
**Village**or**King's Court**. These are really singleton sets, each contain just the named card. - Expansion names like
**Base Set**or**Prosperity**. This includes**Promos**. - Card types, for example
**Treasure**,**Victory**,**Action**. Some less popular or non kingdom cards are not included. For double types see the '*' operator. - Same cost sets:
**Cost 3**,**Cost 4**, etc. The cards that include potion in the cost have a separate group:**Cost Potion**. - And of course the full set:
**All**.

**King's Court**can be also spelled

**kingscourt**or

**Kings-Court**.

### Operators

More complex sets can be achieved using operators on the basic sets:**N * Set**- the sets can have weights assigned to the elements, which affects proportionally the probability they are chosen with. The '*' operator will multiply the weight of each element by**N**. All the basic sets have the weights set to 1.**Set + Set**- union. For elements present in both sets the weight is a sum of their weights in both sets**Set * Set**- intersection. The result weight is the minimum of weights in both sets. Can be used to create double type sets, for example**Action * Victory**as all Action-Victory cards are in both of those basic sets.**Set / Set**- complement. The result is the elements of the first set not present in the second. The result weight from the first set are retained.**(Set)**- expression grouping. As * and / take priority over +, the parenthesis can be used to group expression. For example**(Base Set + Intrigue) * (Cost 3 + Cost 4)**- all cards from those two expansions with cost of 3 or 4.