RRobots is a simulation environment for robots, these robots have a scanner and a gun, can move forward and backwards and are entirely controlled by ruby scripts.
require 'rrobots' class NervousDuck include Robot def tick events turn_radar 1 if time == 0 turn_gun 30 if time < 3 accelerate 1 turn 2 fire 3 unless events['robot_scanned'].empty? end end
All you need to implement is the tick method which should accept a hash of events that occurred during the last tick.
See Robot for full documentation of the methods and accessors available to your AI during the game.
RRobots is implemented in pure ruby using a Gosu ui and should run on all platforms that have ruby and Gosu.
To start a match call:
Usage: rrobots [options] file1 file2 ... --resolution x,y X and Y resolution --match N Replay match number N --timeout N Maximum number of ticks for a match --teams N Splits robots into N teams --[no-]gui Run the match with the GUI -h, --help Show this message
If you want to run a tournament call:
Usage: tournament [options] file1 file2 ... --resolution x,y X and Y resolution --matches N Number of times each robot fights each other robot N --timeout N Maximum number of ticks for a match --dir N All robots from this directory will be matched against each other -h, --help Show this message
The names of the rb files have to match the class names of the robots.
Each robot is matched against each other 1on1. The results are available as yaml or html files.