A rules engine for games in Javascript