<commit_before>$(document).ready(function() {
	var canvas = $("#canvas"), ctx = canvas[0].getContext("2d"); 
	var robots = [], bullets = [];
	
	console.log = function(){};
	
	// utility functions
	var Utils = {
		degree2radian: function(a) {
			return a * (Math.PI/180); 
		},
		distance: function(x1, y1, x2, y2) {
			return Math.sqrt(Math.pow(x1-x2, 2)+Math.pow(y1-y2, 2));
		},
		is_point_in_square: function(x1,y1, x2, y2, width, height) {
			if(
				(x1>=x2) &&
				(x1<=(x2+width)) &&
				(y1>=y2) &&
				(y1<=(y2+height))
			) {
				return true;
			} else {
				return false;
			}
		}, 
	};
	
	
	var ARENA_WIDTH = canvas.width();
	var ARENA_HEIGHT = canvas.height();
	var ROBOT_SPEED = 1;
	var BULLET_SPEED = 3;
	
	var BattleManager = {
		_robots: {},
		_explosions: [],
		_ctx: null,
		
		init: function(ctx, workers) {
			var battle_manager = this;
			battle_manager._ctx = ctx;
			
			for(var w=0; w<workers.length; w++) {
				var robot_id = "robot-" + w;
				var robot = {
					"id": robot_id,
					"x": parseInt((ARENA_WIDTH-150)*Math.random()),
					"y": parseInt((ARENA_HEIGHT-150)*Math.random()),
					"health": 50,
					"direction": 40,
					"turret_direction": 0,
					"radar_direction": 0,
					"bullet": null,
					"events": [],
					"worker": new Worker(workers[w])
				}
				robot["worker"].onmessage = (function(robot_id) {
					return function(e) {
						battle_manager._receive(robot_id, e.data);
					}
				})(robot_id);
				
				battle_manager._robots[robot_id] = robot;
				
				battle_manager._send(robot_id, {
					"signal": "INFO",
					"arena_height": ARENA_HEIGHT,
					"arena_width": ARENA_WIDTH
				});
			}
		},
		
		_receive: function(robot_id, msg) {
			var msg_obj = JSON.parse(msg);
			var battle_manager = this;
			var robot = battle_manager._robots[robot_id];
			<commit_msg>Enable bots spawn in the whole arena<commit_after>$(document).ready(function() {
	var canvas = $("#canvas"), ctx = canvas[0].getContext("2d"); 
	var robots = [], bullets = [];
	
	console.log = function(){};
	
	// utility functions
	var Utils = {
		degree2radian: function(a) {
			return a * (Math.PI/180); 
		},
		distance: function(x1, y1, x2, y2) {
			return Math.sqrt(Math.pow(x1-x2, 2)+Math.pow(y1-y2, 2));
		},
		is_point_in_square: function(x1,y1, x2, y2, width, height) {
			if(
				(x1>=x2) &&
				(x1<=(x2+width)) &&
				(y1>=y2) &&
				(y1<=(y2+height))
			) {
				return true;
			} else {
				return false;
			}
		}, 
	};
	
	
	var ARENA_WIDTH = canvas.width();
	var ARENA_HEIGHT = canvas.height();
	var ROBOT_SPEED = 1;
	var BULLET_SPEED = 3;
	
	var BattleManager = {
		_robots: {},
		_explosions: [],
		_ctx: null,
		
		init: function(ctx, workers) {
			var battle_manager = this;
			battle_manager._ctx = ctx;
			
			for(var w=0; w<workers.length; w++) {
				var robot_id = "robot-" + w;
				var robot = {
					"id": robot_id,
					"x": parseInt((ARENA_WIDTH)*Math.random()),
					"y": parseInt((ARENA_HEIGHT)*Math.random()),
					"health": 50,
					"direction": 40,
					"turret_direction": 0,
					"radar_direction": 0,
					"bullet": null,
					"events": [],
					"worker": new Worker(workers[w])
				}
				robot["worker"].onmessage = (function(robot_id) {
					return function(e) {
						battle_manager._receive(robot_id, e.data);
					}
				})(robot_id);
				
				battle_manager._robots[robot_id] = robot;
				
				battle_manager._send(robot_id, {
					"signal": "INFO",
					"arena_height": ARENA_HEIGHT,
					"arena_width": ARENA_WIDTH
				});
			}
		},
		
		_receive: function(robot_id, msg) {
			var msg_obj = JSON.parse(msg);
			var battle_manager = this;
			var robot = battle_manager._robots[robot_id];
			
{'fraction_non_alphanumeric': 0.17493830545653963, 'fraction_numerical': 0.021935837674801208, 'mean_word_length': 2.9268030139935415, 'pattern_counts': {'":': 26, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6841464', 'n_tokens_mistral': 1796, 'n_tokens_neox': 1404, 'n_words': 264}