Perl MTG Card Generator

If web browser can't handle forms, then you might as well give up on this page right now. Consider acquiring a recent version of netscape.

See below for simple examples, or check out the tutorial for a whole slew of details. To submit the query, press this button: . .

Optional Email address:

Enter your relational query here, as in NAME =~ /urza/i and not AQ

Optional sort order:
Nota bene: Sort fields are just simple words (without quotes) like "color" or "power", not things like "mox" or "giant". And don't use and's or or's, either.

Further Explanation

Be careful: you can't just type the card name by itself all alone on a line and hope it finds something close. For that, you need to use the fuzzy name matcher. In general, the fuzzy matcher is better with names. Its main claim to fame is that it's a lot easier to use for non-programmers out there.

The MoxPerl Card Generator here on this page is infinitely more flexible and powerful. To use it, specify the name field (or whatever) that you're comparing against, and then supply a comparison or two, maybe with extra functions thrown in. Something like each of these lines:

    NAME eq 'White Ward'
    NAME =~ /ward/i
    NAME =~ /djinn|efreet/i
    TYPE =~ /elf/i or TYPE() =~ /dwarf/i
    TYPE =~ /\b(el|dwar)(f|v)/i 
    POWER() > 2 and regenerates
    green critter and POWER() == TOUGHNESS()
    regenerates but not green
    green (flyer or bander)
    CARD =~ /mishra|urza/i
Even though non-progammers haven't much trouble asking about
    flying blue critters
They understandably have problems with:
  creature and !flying
      and 
  toughness() == 1
      and 
  not (LG or UL or AN)
      and
  (common or uncommon)
      and 
  type =~ /\b(el|dwar)[fv]/i 
      and 
  artist eq ${"Fissure"}->{"artist"} 
which, amazingly enough, actually does work just fine to pull out Doug Shuler's Dwarven Warriors and Dwarven Soldiers in under 2 seconds.

If you're doing numeric comparisons involving less-than, then you must use parens after the function call. Normally they're optional, but when in doubt, put them in.

    power() < 3 && cost() > 3

If you want to sort other than by name, put that here. Here are some reasonable sort criteria, each on its own line. The tilde (~) will reverse the sort for that key.

    color ~powtuf
    color rarity 
    ~rarity ~powtuf
    release color type
I strongly suggest you check out the
tutorial for the card generator. The selection criteria (but not the sort order) is actually disguided perl code. If you would like to read about perl, check out the great htmlificated manual.
Mon Jan 2 10:58:59 MST 1995