NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
A Koan (Score:1)
One day, a novice approached the master.
"Master," he said, "there are contradictions in the Tao. To achieve enlightenment, you must clear your mind. To achieve enlightenment, you must be mindful of the Universe."
"Yes," replied the master. "Off by one error."
At this, the novice was enlightened.
Index: t/customertests/AllowPlayersToAttackICE.t
===================================================================
--- t/customertests/AllowPlayersToAttackICE.t (revision 20)
+++ t/customertests/AllowPlaye
Re:A Koan (Score:2)
You either add regen first and then subtract damage (without going below zero) which gives the 41 result you're testing for; or subtract damage first (without going below zero) and then add regen which gives a result of 50. The second is implied by your problem statement (no more damage can be applied than the hit points at the START of the period). A conceivable third approach would be to apply the damage in the middle of te regen: add half of regen value, subtract damage