December 25, 2006

Merry Christmas!
Post by Peter Cooper

Merry Christmas everyone! Here's something for you to enjoy:

print "#{def r(x);rand(x);end; C = "\033["}2J#{C}0;0f#{C}32m"; w=r(20).to_i+13
h=w-r(10).to_i; h.times { |line| puts " " * ((w / 2) - (line / 2)) + 
(1..line+1).collect { r(rand(12)) == 0 ? "#{C+'5m' if % 2 == 0}#{C}#{r(7) + 
31}m*#{C}0m#{C}32m":'='}.join}; print "#{C}33m"; 3.times{ puts (("x" * (w / 6)
).center(w)) }; puts "#{C}0m\n", "Merry Christmas From Ruby Inside!"

Run this code from a terminal, and be sure to run it a few times to enjoy the pretty colors (the results are randomly generated).

I'd like to thank all of those who have frequented the advent calendar and those who have contributed to its creation.

If you aren't a subscriber to Ruby Inside, do consider coming by and checking it out. It's probably the most regular Ruby news site about, and you're bound to find something every week that you hadn't seen before.