[DFW.pm] FizzBuzz Assignment

Nathan Dyck nathan at mitsi.com
Thu Sep 11 10:41:14 PDT 2014


That looks like a C programmer wrote that!
At least that's what my co-workers used to tell me regarding "for" 
loops. :-)

So now I try to be more Perlish and write something like:

foreach my $x (1..100) {
    #insert Bob's remaining code here
}


On 9/11/2014 12:00 AM, Van Der Ploeg, Bob wrote:
>
> Here is my homework assignment.   I know its wordy but it seems to work! J
>
> #!/usr/bin/perl
>
> for($x=1;$x<=100;$x++){
>
> if($x%3==0 && $x%5==0){print "FIZZBUZZ "}
>
> elsif ($x%3==0){print "fizz "}
>
> elsif($x%5==0){print "buzz "}
>
> else{print "$x ";}
>
> }
>
> http://www.facebook.com/robert.vanderploeg
> Deuteronomy 30:19 - Choose Life!
>
> *Bob Van Der Ploeg, Professional Services Consultant*
> Active Network | Faith
> Office: 214.271.9698 <tel:214.271.9698>
> Mobile: 407-432-6665
>
> bob.vanderploeg at activenetwork.com 
> <mailto:bob.vanderploeg at activenetwork.com>
>
> *My ACTIVE is...*
> Faith, Family, Swimming
>
> *What's Your Active?*
>
> http://www.FellowshipOne.com <http://www.fellowshipone.com/>
> http://www.ActiveNetwork.com <http://www.activenetwork.com/>
> http://www.Active.com <http://www.active.com/>
>
>
>
> _______________________________________________
> Dfw-pm mailing list
> Dfw-pm at pm.org
> http://mail.pm.org/mailman/listinfo/dfw-pm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/dfw-pm/attachments/20140911/4c4bc8c6/attachment.html>


More information about the Dfw-pm mailing list