You're organizing a treasure hunt for your friends. To conduct things more easily, you want to draw a map of all locations where you hid the precious objects.
Input
Any form of input denoting a list of points consisting of (nonnegative) x- and y-coordinate, 0 0
being the upper left corner is permitted (Note: You may also use 1-based indexing in your answer, please comment on that if you do). Example:
1 2
3 0
0 1
Challenge
Your function or program should be able to construct a map denoting every given location with an x
where the mark is found in row y + 1 and column x + 1 in the output. Unmarked locations are represented with a
. The map also consists of a frame where the corners are +
s, the vertical lines are |
s and the horizontal lines are -
s. Your solution should output the smallest possible frame. Map for the input example given above:
+----+
| x|
|x |
| x |
+----+
Possible Test Cases
"0 0"
=>
+-+
|x|
+-+
"0 10
5 5
10 0"
=>
+-----------+
| x|
| |
| |
| |
| |
| x |
| |
| |
| |
| |
|x |
+-----------+
""
=>
++
++
"0 0
0 2
2 0"
=>
+---+
|x x|
| |
|x |
+---+
Of course, this is code-golf, meaning that the solution with the lowest byte count wins! Explanations of your solution are encouraged.
the input is a list of locations (e.g. nested list, list of tuples, space & newline separated, separate inputs, ect.)
\$\endgroup\$