Ruby Isn’t Too Bad

Posted by Nessa | Posted in , | Posted on May 2, 2007


I haven’t really had a whole time to play around with Ruby, but I managed to write a little script that I call boobs.rb.  It was my attempt to take advantage of Ruby’s ability to define your own functions. Maybe if I’m lucky I would be able to actually define my own bra size too.


def sayBoobs(name)
result = "Hey, " + name + " wears a size DD. \n "
return result

puts sayBoobs("Nessa")

This puts out something that looks like this:

Be Sociable, Share!

Comments (4)

Hi Nessa :D

Are you going to post some naked pics with a Tuxy tatoo?

ummmm yea I’ll get right on that….and ill make sure that you’re the first person who sees them. In fact, I’m planning on turning this whole website into an interracial gay midget porn ring. Giggity giggity.

In the meantime, I wonder if there are any lonely and hopeless readers out there who spend the better half of their surfing time begging for naked pictures on a programming blog. Hmmm, I wonder.

Can’t believe I’m doing this but, here’s the Ruby Way to write your method:

def sayBoobs(name)
“Hey, #{name} wears a size DD. \n”

puts sayBoobs ”Nessa”

In Ruby, methods ‘return’ the result that was last evaluated so we don’t have to write it explicitly.

Surfing is really the best sport out there, i love the adrenaline rush when surfing on big waves.:””

Post a comment