Slash Boxes
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • 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

    • You still look backwards to me.

      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 (max current hit points), add remaining regen. In this case, that would again result in 41, but if the regen amount were 10 instead of 50 the three results would all differ (damage then regen: 10; half regen then damage then half regen: 5; regen then damage: 1).