I received an email from an author regarding the writing of rules, and I
used an important "trick" to figure out the problem that might not be
obvious to everyone. So I thought I would post it here for everyone to use
as a debugging aid when writing rules.
The trick is to use stats for debugging rules.
Why? Well, stats can give you direct feedback about the values that are
being used within rules. For example, if I've got a rule that is based on a
particular tag expression, I can define each term of that expression as a
separate stat. Then I can see the actual numbers for each of those terms
within the stat display in CV.
Once I have the stats in place, I can add cards to the deck and what the
stats get calculated appropriately. If the stats don't look right, then you
can check the tags on cards to find out why the stats aren't tallying
correctly. Once the stats look right, then you know the basic values used
in the rules are correct. So now all you need to worry about is making sure
the logic of the rule is correct, instead of also trying to determine
whether the component elements of the rule are correct.
This technique makes it much easier to diagnose rules and get them working
in CV. I hope this proves useful to some of you authors (and would-be
authors) out there.
Thanks, Rob
---------------------------------------------------------------------------
Rob Bowes (rob@wolflair.com) (559) 658-6995
Lone Wolf Development www.wolflair.com
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/WuQolB/TM
---------------------------------------------------------------------~->
used an important "trick" to figure out the problem that might not be
obvious to everyone. So I thought I would post it here for everyone to use
as a debugging aid when writing rules.
The trick is to use stats for debugging rules.

Why? Well, stats can give you direct feedback about the values that are
being used within rules. For example, if I've got a rule that is based on a
particular tag expression, I can define each term of that expression as a
separate stat. Then I can see the actual numbers for each of those terms
within the stat display in CV.
Once I have the stats in place, I can add cards to the deck and what the
stats get calculated appropriately. If the stats don't look right, then you
can check the tags on cards to find out why the stats aren't tallying
correctly. Once the stats look right, then you know the basic values used
in the rules are correct. So now all you need to worry about is making sure
the logic of the rule is correct, instead of also trying to determine
whether the component elements of the rule are correct.
This technique makes it much easier to diagnose rules and get them working
in CV. I hope this proves useful to some of you authors (and would-be
authors) out there.

Thanks, Rob
---------------------------------------------------------------------------
Rob Bowes (rob@wolflair.com) (559) 658-6995
Lone Wolf Development www.wolflair.com
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/WuQolB/TM
---------------------------------------------------------------------~->