Ruby Isn’t Too Bad

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.

#!/usr/bin/ruby


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


puts sayBoobs("Nessa")

This puts out something that looks like this:

Be Sociable, Share!

4 thoughts on “Ruby Isn’t Too Bad

  1. 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.

  2. 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”
    end

    puts sayBoobs ”Nessa”

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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>