On Jul 15, 2007, at 5:28 PM, Joe Wiltrout wrote:

> How does the stupid Hello
> World thing work? What exactly does it do? How can I apply it to  
> making
> a game? Say I wanted to make a pirate say Hello World!, how would I do
> that? How would I make the pirate saying Hello World? What color  
> should
> his hat be?

#!/usr/bin/env ruby -wKU

class Pirate < Struct.new(:hat_color)
   def to_s
     <<-END_HELLO.gsub(/\s+/, " ")
     The #{self.class}#{", with the #{hat_color} hat," if hat_color}
     says, "Avast ye scavy dog!"
     END_HELLO
   end
end

puts Pirate.new
puts Pirate.new("fancy black")
# >>  The Pirate says, "Avast ye scavy dog!"
# >>  The Pirate, with the fancy black hat, says, "Avast ye scavy dog!"

__END__

James Edward Gray II