Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Golf Challenge: FizzBuzz

by shmem (Canon)
on Mar 04, 2007 at 22:11 UTC ( #603139=note: print w/replies, xml ) Need Help??


in reply to Re: Golf Challenge: FizzBuzz
in thread Golf Challenge: FizzBuzz

print+(Fizz)[$_%3].(Buzz)[$_%5]||$_,$/for 1..100
scores 48, and wins!
Hmm? That's the solution I posted to FizzBuzz before this thread even started...

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^3: Golf Challenge: FizzBuzz
by blazar (Canon) on Mar 04, 2007 at 23:52 UTC

    Well done, then, I wanted to write "which is also shmem's solution", but I didn't because in this thread the other one appeared first. I won't update my node to acknowledge that you came first, since... well... these further followups do. Compliments again!

Re^3: Golf Challenge: FizzBuzz
by tweetiepooh (Friar) on Jun 02, 2009 at 15:25 UTC
    #2345678901234567890123456789012345678901234567 warn+(Fizz)[$_%3].(Buzz)[$_%5]||$_,$/for 1..100
    also works with one fewer characters.
    #2345678901234567890123456789012345678901234 perl -M5.01 -e 'say+(Fizz)[$_%3].(Buzz)[$_%5]||$_,for 1..100'
    But this isn't really golf since you need to add -M5.01 to the calling statement.

      As you can see from the date of the post to which you answered, it was written previous to the release of perl5.10 - there is no 'say' in 5.8.8...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://603139]
help
Chatterbox?
[cbeckley]: I have a functioning module I use to spawn sets of commands across multiple servers.
[cbeckley]: It's nascent, and probably looks like baby Perl to the veterans.
[cbeckley]: I have several questions about it's future development. But it seems like a lot of code to put in a sopw.
[cbeckley]: Should I put the module and example calling code in cufp, and then ask questions in sopw?

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2017-03-24 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (304 votes). Check out past polls.