Some writing by Trek

& archive, twitter, github

Old Joke

by Trek on

We talked about assignment (=) and equality (==) today. Always reminds me of the old joke:

if foreigner = terrorist
  imprison(foreigner)
else
  release(foreigner)
end

which reminds me of a new joke:

class Economy
  def slowing?
   self.value.today < self.value.yesterday
  end

  def slow_by(amount)
    self.value -= amount
  end
end

class Money
  def self.print(amount = 10000)
    0.upto(size) do
     self.economy << Money.new
    end
    self.economy.slow_by(amount)
  end
end

economy = Economy.new('United States', 'United States Dollars')

while(economy.slowing?)
  Money.print
end

blog comments powered by Disqus