Jay McGavren's Journal

How a Head First author spends his days off

View on GitHub
2008-08-27

OK, so it's not useful NOW...

Added to “utility/enhancements.rb”…

class String
	#Uses Windows Speech API to speak string.
	def speak
		require 'win32/sapi5'
		Win32::SpVoice.new.Speak(self.to_s)
	end
end

99.downto(1) {|n| "#{n} bottles of beer on the wall".speak}
Copyright © Jay McGavren.