Smallest FizzBuzz program

On 3/3/07, Rick DeNatale [email protected] wrote:

And here I could have sworn that I’d actually tried that very code in irb.

That’s why I’m against code golfing, rots the brain! :wink:
That’s why I love it, nothing to lose :wink:
But this one got on my nervers now, good night everyone!

I was trying to submit to program for the prime number challenge, but I
can’t make it work because I don’t understand how does this website do
the
input to the submitted programs.
I mean that when I use ARGV or $*, it seems these variables are empty
(just
submitting a test program that does a “pp ARGV” outputs an empty array).

Is there anyone who knows how can I get the input for this website ?

Brian A. wrote:

This is really bugging me. Someone posted a golf challenge to write a
smallest FizzBuzz program here:

http://golf.shinh.org/p.rb?FizzBuzz (although the site was down when I
checked it a few minutes ago)

I submitted the resulting program to the site (which is back up now)
under ‘comp.lang.ruby’ since multiple people contributed. Comes in at 57
bytes - only 1 byte longer than the best. So apparently the site does
count the EOF byte.

1.upto(?d){|i|i%3<1&&x=:Fizz;puts i%5<1?"#{x}Buzz":x||i}

http://golf.shinh.org/p.rb?FizzBuzz

Interestingly, the following Ruby program (with a little help from sed
that my friend passed along) comes in at exactly 56 bytes, but the test
site rightfully failed it due to the attempt to shell the command:

puts seq 100|sed -e'5~5s/.*/Buzz/;3~3s/^[0-9]*/Fizz/'

On 3/5/07, Guillaume Nargeot
[email protected] wrote:

I was trying to submit to program for the prime number challenge, but I
can’t make it work because I don’t understand how does this website do the
input to the submitted programs.
I mean that when I use ARGV or $*, it seems these variables are empty (just
submitting a test program that does a “pp ARGV” outputs an empty array).

Is there anyone who knows how can I get the input for this website ?

Did you try to read from $stdin? I know that is kind of stupid to ask,
but sometimes we do not see what is hidden in front of our eyes :slight_smile:

Robert

On 3/7/07, Jenda K. [email protected] wrote:

Hey! Stop this! It’s supposed to be the dreadfull scripting language
called Pearl that’s totally unreadable and it’s abusers waste the
precious time trying to beat each other by writing something in as few
characters as possible!

The email address simply drips irony :slight_smile:

m.

Brian A. wrote:

This is really bugging me. Someone posted a golf challenge to write a
smallest FizzBuzz program here:

Hey! Stop this! It’s supposed to be the dreadfull scripting language
called Pearl that’s totally unreadable and it’s abusers waste the
precious time trying to beat each other by writing something in as few
characters as possible!

:stuck_out_tongue:

Jenda

On 3/7/07, Rick DeNatale [email protected] wrote:

And what’s pearl? I thought it was perl. What does it mean if one
doesn’t know how to properly spell one’s favorite language?

You could always tell who was really in the Smalltalk community or at
least who wasn’t when they spelled it SmallTalk.


Rick DeNatale

Oh Rick just forget him, he will become a stone in the sun.

R

On 3/7/07, Robert D. [email protected] wrote:

Oh Rick just forget him, he will become a stone in the sun.

Why does conjure up a picture of Mick J. lying on a beach?

On 3/7/07, Martin DeMello [email protected] wrote:

On 3/7/07, Jenda K. [email protected] wrote:

Hey! Stop this! It’s supposed to be the dreadfull scripting language
called Pearl that’s totally unreadable and it’s abusers waste the
precious time trying to beat each other by writing something in as few
characters as possible!

The email address simply drips irony :slight_smile:

And what’s pearl? I thought it was perl. What does it mean if one
doesn’t know how to properly spell one’s favorite language?

You could always tell who was really in the Smalltalk community or at
least who wasn’t when they spelled it SmallTalk.

On 3/7/07, Robert D. [email protected] wrote:

On 3/7/07, Rick DeNatale [email protected] wrote:

On 3/7/07, Robert D. [email protected] wrote:

Oh Rick just forget him, he will become a stone in the sun.

Why does conjure up a picture of Mick J. lying on a beach?

I guess I lack some cultural reference to understand this :slight_smile:
I was just talking about Trolls as in Tollkien et al…

Mick J. is the lead singer of the Rolling Stones.

Robert my friend you must be either very old or very young (more likely)


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On Thu, Mar 08, 2007 at 04:01:46AM +0900, Rick DeNatale wrote:

And what’s pearl? I thought it was perl. What does it mean if one
doesn’t know how to properly spell one’s favorite language?

Actually, in this context, I think “Jenda” is being intentionally
ironic. That’s a jab at people who complain about Perl being unreadable
and suitable only for golf and obfu.

On 3/7/07, Rick DeNatale [email protected] wrote:

On 3/7/07, Robert D. [email protected] wrote:

Oh Rick just forget him, he will become a stone in the sun.

Why does conjure up a picture of Mick J. lying on a beach?


Rick

I guess I lack some cultural reference to understand this :slight_smile:
I was just talking about Trolls as in Tollkien et al…

R.

On 3/8/07, Rick DeNatale [email protected] wrote:

Mick J. is the lead singer of the Rolling Stones.

Robert my friend you must be either very old or very young (more likely)

Actually I am quite old (not as old as the Stones but almost), but
incredibly stupid, I just did not get the pun!!!


Rick DeNatale
Thx for bringing the light to the blind.

Robert

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs