If you are having trouble getting started with Ruby.. this might help you play around with it while having fun too

It was posted to comp.lang.ruby:
http://www.ruby-forum.com/topic/15285

Download here:
http://rubyforge.org/frs/?group_id=1109&release_id=3602

battle my robot (I also posted it to the list):
Code:
require 'robot'

class Testing
    include Robot

    def initialize bf
        super(bf)
        @saw_robot = false
    end
    def tick events

        accelerate 1

        if @saw_robot
            direction = time%2==0 ? -1 : 1
            turn_gun 20*direction
            turn 1*direction

            @saw_robot = false
        else
            turn_gun 10
            turn 2
            
        end

        if !events['robot_scanned'].empty?
            fire 1 
            @saw_robot=true
        end
    end
end
now post yours..