Tuesday, April 21, 2015

My Personal Code for 4/20/15

At work on Friday, the first phone call I received was from a gentleman in California who is in the very early stages of his solar project (We haven't even designed his solar system yet), who wanted to know if my company had put balloons in his front yard. I was baffled as to why he would think this, but apparently his sales rep had told him that we might have a bbq in his front yard on the day of install. That sounded like something our marketing director had mentioned a while back, so I brought it up to my manager, who laughed. "No. As far as I know we aren't putting balloons in anyone's front yard."

"Well, I thought it was over the top, but I have no idea who put these balloons in my yard." The man grumbled.

Despite the man's disgruntled response to the balloons, my mind wizzed off into fantasy land. That would be so fun and exciting to wake up and find balloons in your yard and have no idea who they came from. A happy mystery to find out who was so sweet. 

So obviously I went to the supermarket that evening to buy helium balloons with sweet sentiments plastered over their plump mylar surface: "You're #1", "You're the Best", "Just because You're you!" My friend and I decided we would deliver them to houses in our area where the front yard looked like it was in disrepair-- people who looked like they had a lot on their plate and could use something to cheer them up. Also, I decided to leave one in my friend Arthur's yard -- because when it comes to good people, he really is the best.

The operation was a wild success... at least as far as I know. We ended up deciding to deliver balloons to three people we know as well as three people we do not-- and sort of gauge the reaction of people we know to see wether it was a success or not... well 2/3 of the people we know reported on their FB that they were tickled and baffled.




Soo as part of my write a code about something I did today project... I wrote the following code for a really boring choose your adventure style game (in Ruby)...


def buy(balloons) #how much will you pay to purchase balloons
   @balloons = balloons
      cost = @balloons*3
      puts "you spent $ #{cost} on #{@balloons} balloons. Lets give them out."
   end
 
    def distrib (balloons) # where will you leave them
    @balloons = balloons
    while @balloons > 0
    puts "You come to a house. Is this Arthur's house? y or n?"
    @arthur = gets.chomp.downcase
        unless @arthur == 'y' or @arthur == 'n'
        puts "You come to a house. Is this Arthur's house? y or n?"
    @arthur = gets.chomp.downcase
    end #unless valid answer
    puts "Is there a lawn here? y or n?"
    @lawn = gets.chomp.downcase
        unless @lawn == 'y' or @lawn == 'n'
        puts "Is there a lawn at this house? y or n?"
    @lawn = gets.chomp.downcase
end # unless lawn
        if @lawn == "n" or @arthur == "y"
        puts "lets leave a balloon here."
            @balloons -= 1
        else
            puts "well, they probably don't need a balloon then."
        end #if lawn
            puts "you have #{@balloons} left. Let's give out some more."
    end #while balloonss >0
    end # distrib

buy(6)
distrib(6)

No comments:

Post a Comment