diff options
author | B. Watson <yalhcru@gmail.com> | 2015-12-29 23:10:50 -0500 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2015-12-29 23:10:50 -0500 |
commit | 2300d2813a524cbfeabac794335e7abe99263df6 (patch) | |
tree | d729ca4f99634788cbb3a2101a5b5854a4bc2d06 /debt.pl | |
download | taipan-2300d2813a524cbfeabac794335e7abe99263df6.tar.gz |
initial commit
Diffstat (limited to 'debt.pl')
-rw-r--r-- | debt.pl | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -0,0 +1,17 @@ +#!/usr/bin/perl -w + +my $debt = shift || 1000; +my $idebt = $debt; + +my $months = shift || 100; +for(1..$months) { + $debt += $debt * 0.1; + if($idebt > 16) { + $idebt += (($idebt >> 4) + ($idebt >> 5) + ($idebt >> 7) - ($idebt >> 9)); + } else { + $idebt++; + } + # print "$debt\t$idebt\n"; + $pct = $idebt * 100 / $debt; + printf("%.2d\t$idebt\t%.1d%%\n", $debt, $pct); +} |