in reply to 1,000 bucks
my $amount = shift; # disperse amount die "must be integer" if $amount != int($amount); die "too big" if $amount > 1000; die "too small" if $amount < 1; for (my $en = 1; $amount; $en <<= 1) { next unless $amount & $en; print "Giving you envelope with $en\n"; $amount &= ~ $en; }
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: 1,000 bucks
by cforde (Monk) on May 18, 2001 at 01:05 UTC | |
by larryk (Friar) on May 24, 2001 at 00:12 UTC |