Posts RSS Comments RSS 94 Posts and 64 Comments till now

Archive for January, 2008

Hamlet in Ruby (Version 2)

question = self.be?

o_f = fortune(:outrageous)
suffer = s.mind.suffer(slings(o_f) && arrows(o_f))

sea_of_trouble = [:trouble, :trouble, :trouble]
fight = sea_of_trouble.map { |t| kill self.arm.take.against(t) }

nobler = suffer > fight ? suffer: fight

if fork == 0
  while 1
    sleep
  end
else
  die
end

nil  # no more

Hamlet in Ruby

question = self.be?

self.call nobler? ?
    lambda{|s| s.mind.suffer([:slings, :arrows].each {|x| fortune(:outrageous, x) }) }
  : lambda{|s| s.fight_and_kill([:trouble, :trouble, :trouble]) }

if fork == 0
  while 1
    sleep
  end
else
  die
end

# no more