Project

brawl

0.0
No commit activity in last 3 years
No release in over 3 years
Write robotic assassins using Ruby and watch them as they do your evil bidding.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Brawl

A dangerous robotic programming game that will kill you in your sleep.

Write robotic assassins using Ruby and watch them as they do your evil bidding.

Status

Alpha Development

Brawl is a work in progress but currently supports running bots on your local machine with limited security.

Features

The framework is designed from the ground up to be extendable. Want to add some new functionality to robots like dropping land mines, semi-intelligent turrets, or heat seeking missiles? Just write a new part and load it into your bot.

Security

Brawl was also designed to be secure (when the DRb methodology is implemented). In the secure version (in prototype stage now) bot code runs in a $SAFE = 3 process fork and communicates via a wrapper that uses DRb to talk to a proxy object.

Whew, that was a mouth full but what it basically means is you can feel reasonably safe running other people's code on your machine. They won't be able to erase your hard drive, probably, much less hack your bots or the game engine to cheat.

Legal Notice: This is not a guarantee of fitness or anything else. If you use other people's code without understanding what it does expect your entire system to melt.

Example bot programs

This is a really dumb robot that just scans for enemies and shoots at them. If it can't find an enemy it will move around till it does. How would you improve it?

code do |bot|
  @dir ||= 0
  targets = bot.scan direction: @dir, angle: 90
  @dir += 45
  @dir %= 360
  unless targets.each do |target|
      unless target[:class] == Brawl::Wall
        results = shoot(target[:bearing])
      end
    end.empty?
  else
    if rand(0) > 0.5
      bot.turn [:left,:right,:around].sample
    end
    bot.move rand(3) + 1
  end
end