Quote:
|
Originally Posted by scuzzman
Thanks! Would changing this to a constant achieve my desired result, or would I need to just write a subfunction to repeatedly do the calculation?
|
A subroutine sounds your best bet:
sub findProd {
my $level = shift @_;
return (20 * $level) * (1.1 ** $level);
}
...
$level++ while (findProd($level) <= $goal);