print "Life and death are balanced on the edge of a razor.\n"; sub razorsEdge { $life=shift; $death=shift; if ($death == $life) { $life = int(rand($death+1)*2); $death = int(rand($life+1)*2); } $life++ if ($life < $death); $death-- if ($death > $life); $life-- if ($life > $death); $death++ if ($death < $life); razorsEdge($life, $death); } razorsEdge($life, $death);

Replies are listed 'Best First'.
Re: Life and death are balanced on the edge of a razor
by ghernandez (Novice) on Jan 29, 2015 at 05:29 UTC
    So this function, I wrote it after my mom died, became rather morbid. Some cool things about this is that, 1) its recursive, it will always follow itself 2) Without adding +1 and +1 to the first if clause, eventually the counter will hit zero and be this way forever, it wont ever get out of zero state. a) it takes two people for love, and to make new life 3) it runs forever and never gives up. Life doesnt end. Life struggles onwards forever, no matter how death strikes.