Ahn-simon-game is a project mainly written in Ruby, it's free.
An example component that implements the popular Simon Says game.
gem install ahn-simon-game
In dialplan.rb: mycontext { simon_game }
(c) 2011 Mojolingo LLC