Pizza Party for 100
Hi all, this is my first blog post! Yay!
Now that that's out of the way, I'd just like to go over my solution for this week's Perl weekly challenge.
The first challenge was to divide a pie between 100 people, in a manner where the first guest gets 1/100 (i.e. 1%) of the pie, and the second gets 2/100 (i.e. 2%) of what remained, etc etc. The question is, who got the biggest piece of pie.
If I were better at math, I would prove that the answer is the square root of the amount of guests, because that does seem to be the case. Since I'm not, I solved it procedurally, as follows.
We set up our guests. We allow for the user to pass in a value on the command line, to check values other than 100, but default to 100:
use v5.22; #that's my perl
my $guests = shift // 100;

