huge changed in judge & manager
huge improve

diff --git a/src/judge/Bios.rb b/src/judge/Bios.rb
index 11d5d31..cc7b305 100755
--- a/src/judge/Bios.rb
+++ b/src/judge/Bios.rb
@@ -25,4 +25,5 @@ class Bios
 			ret = s if s.name == name
 		end
 		ret
+	end
 end
\ No newline at end of file
diff --git a/src/judge/Interpreter.rb b/src/judge/Interpreter.rb
index 5fcb901..df7489e 100644
--- a/src/judge/Interpreter.rb
+++ b/src/judge/Interpreter.rb
@@ -7,6 +7,7 @@ module Interpreter
 	end

 	def run(command, face_robot)
+		die(nil, nil) if command == nil
 		self.send(command.cmd, command.args, face_robot)
 	end

diff --git a/src/judge/Judge.rb b/src/judge/Judge.rb
index 289455e..e23a0f6 100644
--- a/src/judge/Judge.rb
+++ b/src/judge/Judge.rb
@@ -1,5 +1,7 @@
 require "json"
 require "bunny"
+require "redis"
+require "./Match"

 module Judge
 	def self.main
@@ -31,5 +33,10 @@ module Judge

 	def self.subscribe(msg)
 		data = JSON.parse(msg)
+		redis = Redis.new
+		competitors = []
+		data["competitors"].each do |variable|
+
+		end
 	end
 end
diff --git a/src/judge/Match.rb b/src/judge/Match.rb
index 9b0a885..f44fa1b 100644
--- a/src/judge/Match.rb
+++ b/src/judge/Match.rb
@@ -10,7 +10,7 @@ class Match
 			x = rand(16)
 			y = rand(16)
 			face = rand(4)
-			robot = Robot.new(x, y, face, true)
+			robot = Robot.new(x, y, face, index + 1, true)
 			robot.load_script(c)
 			@robots.push(robot, -robot.delay)
 			@map[x][y] = robot
@@ -28,9 +28,15 @@ class Match
 			b.level <=> a.level
 		end
 		robot.each do |r|
+			next unless r.power
+			oldx, oldy = r.x, r.y
 			newx, newy = face_location
-			r.next_command(map[newx][newy])
-			@robots.push(r, -r.delay)
+			live = r.next_command(map[newx][newy])
+			map[oldx][oldy] = nil
+			if live
+				@robots.push(r, -r.delay)
+				map[r.x][r.y] = r
+			end
 		end
 	end
 end
\ No newline at end of file
diff --git a/src/judge/Robot.rb b/src/judge/Robot.rb
index 5696446..b16be26 100644
--- a/src/judge/Robot.rb
+++ b/src/judge/Robot.rb
@@ -10,13 +10,15 @@ class Robot
 	attr_reader :face
 	attr_reader :level
 	attr_reader :delay
+	attr_reader :team

 	include Interpreter

-	def initialize(x, y, face, power = false, level = Global::Creature, bois = Bois.new, code = Code.new)
+	def initialize(x, y, face, team, power = false, level = Global::Creature, bois = Bois.new, code = Code.new)
 		@x = x
 		@y = y
 		@face = face
+		@team = team
 		@level = level
 		@bios = bois
 		@code = code
@@ -30,7 +32,7 @@ class Robot
 		self.extend(Preprocessor)
 		process(script)
 		@seek = @bios.find_segement("main").offset
-		@delay = Delay[@code[@seek]]
+		@delay = Global::Delay[@code[@seek]]
 	end

 	def create(x, y, face, level, power = false)
@@ -38,6 +40,12 @@ class Robot
 	end

 	def face_location
-		@x + Global::Movex(@face), @y + Global::Movey(@face)
+		[@x + Global::Movex(@face), @y + Global::Movey(@face)]
+	end
+
+	def next_command(face_robot)
+		run(@code[@seek])
+		@seek += 1
+		@delay = Global::Delay[@code[@seek]]
 	end
 end
\ No newline at end of file
huge improved
Merge branch 'develop' of github.com:SHSTuring/norewar into develop