Walt Mankowski on 13 Sep 2017 09:24:43 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Why Can't Programmers.. Program?


Oh, and here's my perl one-liner version:

$ perl -E 'say $_ % 15 == 0 ? "fizzbuzz" : $_ % 3 == 0 ? "fizz" : $_ % 5 == 0 ? "buzz" : $_ for 1..100'

On Wed, Sep 13, 2017 at 11:00:04AM -0400, Walt Mankowski wrote:
> Yes, that's a famous coding problem. It's not hard, but it's a bit
> trickier than it seems, and that tends to trip people up. It's also a
> lot harder if you've forgotten about the modulus operator (% in C and
> many derived languages).
> 
> On Wed, Sep 13, 2017 at 10:47:25AM -0400, ronpguilmet wrote:
> > This is not New, but it is new to me. Apparently this is a programming interview question to weed out applicants. It's called FizzBuzz.
> > Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
> > https://blog.codinghorror.com/why-cant-programmers-program/
> > 
> > 
> > 
> > Sent from my T-Mobile 4G LTE Device
> 
> > ___________________________________________________________________________
> > Philadelphia Linux Users Group         --        http://www.phillylinux.org
> > Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> > General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
> 



> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

Attachment: signature.asc
Description: PGP signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug