Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: Golf Challenge: FizzBuzz

by blazar (Canon)
on Mar 03, 2007 at 15:32 UTC ( #603064=note: print w/ replies, xml ) Need Help??


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

Update: Otherwise, you can still make it shorter:
die+map{(Fizz)[$_%3].(Buzz)[$_%5]||$_}1..100

Generally printing to STDERR is not considered equivalent to printing to STDOUT.

Update 2: As Sidhekin pointed out to me, the -l switch makes the newline problems go away.

But under common golfing rules -l does count as +3 strokes. Changing

$_ for

to

$_,$/for

adds two.


Comment on Re^4: Golf Challenge: FizzBuzz
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://603064]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-30 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls