Skip to content

Commit

Permalink
fixed error
Browse files Browse the repository at this point in the history
  • Loading branch information
david karapetyan committed Apr 22, 2012
1 parent 8c8ca49 commit a530538
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions players/secure_bot_net.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'pry'
# identification secrets
secrets = (1..(10 + rand(10))).map { rand(100000) }
secrets_length = secrets.length
Expand Down Expand Up @@ -54,7 +53,7 @@ def self.extended(base)
enemies = Game.world[:players].reject {|p| friends.include?(p) || p == self}
hp = {}
enemies.sort! {|a,b| (hp[a] ||= a.stats[:health]) <=> (hp[b] ||= b.stats[:health])}
enemies.select! {|e| hp[e] <= (collective_strength - e.stats[:defense] / 2)}
enemies.select! {|e| (hp[e] || 0) <= (collective_strength - e.stats[:defense] / 2)}
return enemies[0], friends
end
Expand Down

0 comments on commit a530538

Please sign in to comment.