Weird,

I believe one could come up with pretty much anything and it'll fit your description. Just the other day I wrote this line of code,
my $max_lines = 100; . . . while ($line--) { . . . # do stuff . . . }
So, basically, variable $max_lines leaves variable $line in the dumps if you consider $line-- as a variable loosing HP, {GRIN}.

UPDATE:

Or how abut this:
my $playera = 100; my $playerb = 100; print "player A HP | player B HP\n"; while (1) { $playera -= rand(10); $playerb -= rand(10); print "$playera | $playerb\n"; die (($playera < $playerb) ? "player A lost!" : "player B lost!") if ($playera < 0 || $playerb < 0); }
This 'game' playes out as follows:
player A HP | player B HP 94.0023803710938 | 99.3478393554688 88.4292602539063 | 96.0552978515625 88.1494140625 | 94.9520874023438 86.5380859375 | 93.8046264648438 82.1652221679688 | 84.6536254882813 75.5804443359375 | 76.0702514648438 69.7055053710938 | 75.4898071289063 67.3040771484375 | 68.40087890625 63.6215209960938 | 64.7930908203125 58.9315795898438 | 60.8502197265625 50.4647827148438 | 57.1435546875 40.8901977539063 | 49.0029907226563 34.7552490234375 | 39.5355224609375 27.4127197265625 | 33.8937377929688 24.0670776367188 | 31.5869140625 19.4973754882813 | 22.3440551757813 10.3622436523438 | 14.5086669921875 9.0966796875 | 11.1148071289063 7.37579345703125 | 9.4158935546875 2.77679443359375 | 0.14801025390625 -1.7657470703125 | -7.55615234375 player B lost! at temp.pl line 11.
you says: "The barer the bones, the better"

I guess my code is as 'bare' as you can get (unless some monk out there wants to challange me)! ;-)

_____________________
$"=q;grep;;$,=q"grep";for(`find . -name ".saves*~"`){s;$/;;;/(.*-(\d+) +-.*)$/; $_=["ps -e -o pid | "," $2 | "," -v "," "];`@$_`?{print"+ $1"}:{print" +- $1"}&&`rm $1`; print$\;}

In reply to Re: Battle script by vladb
in thread Battle script by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.