@verb #1177:"msg_map offsets" this none this rxdo #1177 @program #1177:"msg_map offsets" this none this "Examine the room locations and find the edges." minx = miny = maxx = maxy = 0 for data in (this.intersection_db) {x, y} = data[1] minx = min(minx, x) miny = min(miny, y) maxx = max(maxx, x) maxy = max(maxy, y) endfor if (verb == "offsets") return {minx, miny, maxx, maxy} endif "Create a canvas of the right size." width = abs(minx) + abs(maxx) + 1 height = abs(miny) + abs(maxy) + 1 map = $list_utils:make(height * 3, $su:space(width * 4)) "Populate the canvas with data." for data in (this.intersection_db) {x, y} = data[1] mapx = x * 4 + 2 - minx * 4 mapy = y * 3 + 2 - miny * 3 mapy = height * 3 - mapy + 1 map[mapy][mapx] = {x, y} == {0, 0} ? "@" | "+" map[mapy + 1][mapx] = "|" map[mapy - 1][mapx] = "|" map[mapy][mapx + 1] = "-" if (this:xy_exists(x + 1, y)) map[mapy][mapx + 2] = "-" endif map[mapy][mapx - 1] = "-" if (this:xyz_exists(x, y, "NW")) map[mapy - 1][mapx - 1] = "." endif if (this:xyz_exists(x, y, "NE")) map[mapy - 1][mapx + 1] = "." endif if (this:xyz_exists(x, y, "SW")) map[mapy + 1][mapx - 1] = "." endif if (this:xyz_exists(x, y, "SE")) map[mapy + 1][mapx + 1] = "." endif endfor "Add the compas" if (length(map) >= 5) map[1] = map[1] + " N" map[2] = map[2] + " |" map[3] = map[3] + "W-*-E" map[4] = map[4] + " |" map[5] = map[5] + " S" endif return map "Last modified by Dax (#789) on Sun Sep 1 23:40:32 2002 MDT." .