berlin-ai 0.0.23 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ai/fake.rb +4 -2
- data/lib/version.rb +1 -1
- metadata +1 -1
data/lib/ai/fake.rb
CHANGED
@@ -112,7 +112,7 @@ module Berlin
|
|
112
112
|
|
113
113
|
def initialize(state)
|
114
114
|
js = state.as_json
|
115
|
-
@player_ids = js.map{ |n| n['player_id'] }.uniq
|
115
|
+
@player_ids = js.map{ |n| n['player_id'] }.uniq.compact
|
116
116
|
|
117
117
|
js.each do |node|
|
118
118
|
id = node['node_id'].to_s.rjust(2)
|
@@ -129,7 +129,7 @@ module Berlin
|
|
129
129
|
|
130
130
|
def as_display
|
131
131
|
## The map is fully dynamic
|
132
|
-
<<-MAP
|
132
|
+
map = <<-MAP
|
133
133
|
____ ____ ____
|
134
134
|
/ \\ / \\ / \\
|
135
135
|
| #{n1.id} |---------| #{n2.id} |---------| #{n3.id} |
|
@@ -150,6 +150,8 @@ module Berlin
|
|
150
150
|
| #{n6.ns} | | #{n7.ns} | | #{n8.ns} |
|
151
151
|
\\____/ \\____/ \\____/
|
152
152
|
MAP
|
153
|
+
|
154
|
+
[map, *@player_ids.map{ |id| id.to_s.foreground(color(id)) }].join("\n")
|
153
155
|
end
|
154
156
|
end
|
155
157
|
|
data/lib/version.rb
CHANGED