def get_display(startStreet, startAvenue, streetsTowardNorth, avenuesTowardEast)
xBound = 2 * streetsTowardNorth + 1
yBound = 2 * avenuesTowardEast + 1
display = []
(0 ..xBound).each do |i|
display<<[]
display<<[]
(avenuesTowardEast + 1).times do |j|
display[2*i + 1]<< " . "
display[2*i + 1]<< " "
display[2*i]<< " "
display[2*i]<< " "
end
end
@beepers.keys.each do |key|
x, y = key[0], key[1]
howMany = @beepers[key]
if howMany > 9
cell = " * "
elsif howMany < 0
cell = "inf"
elsif howMany > 0
cell = " " + howMany.to_s + " "
else
cell = " . "
end
x = 2 * (x - startStreet) + 1
y = 2 * (y - startAvenue)
display[x][y] = cell if visible(x, y, xBound, yBound)
end
bottom = 2 * (1 - startStreet)
left = 2 * (1 - startAvenue)
yBound.times {|i| display[bottom][i] = "___"} if bottom >= 0 and bottom < xBound
(xBound - 1).times {|i| display[i+1][left-1] = display [i][left-1]= "|"} if left >= 1 and left < yBound
@east_west_walls.keys.each do |key|
x, y = key[0], key[1]
x = 2 * (x - startStreet) + 1
y = 2 * (y - startAvenue)
display[x + 1][y] = "___" if visible(x + 1, y, xBound, yBound)
end
@north_south_walls.keys.each do |key|
x, y = key[0], key[1]
bottom = x
x = 2 * (x - startStreet);
y = 2 * (y - startAvenue) + 1;
if visible(x + 1, y, xBound, yBound)
display[x + 1 ][y] = display[x][y] = " | "
display[x][y] = "_|_" if bottom == 1
end
end
return display
end