Introduction
Given this visualization of a playing field:
(0,0)
+----------------------+(map_width, 0)
| A |
|-----+-----------+----|
| D | W | B |
|-----+-----------+----|
| C |
+----------------------+(map_width, map_height)
(0, map_height)
The entire map the game is played on is the rectangle with the corner coordinates (0,0) and (map_width, map_height). The points eligible for spawning enemies is the Union $$S = \bigcup (A, B, C, D) $$
The Challenge
Write code that returns a random point(x, y) that is guaranteed to be inside S. Your code cannot introduce any additional bias, meaning that the probability of each coordinate is uniformly distributed given the assumption that your choice of generating randomness (e.g. function|library|dev/urandom) is unbiased.
Shortest solutions in bytes win!
Input
You will be given a total of 6 positive integer input variables in order:
map_width, map_height, W_top_left_x, W_top_left_y, W_width, W_height
. You can assume that the (calculated) surface area of all regions(A,B,C,D,W) is each >10, so there are no empty spaces/regions.
Example Input: 1000, 1000, 100, 100, 600, 400
The input has to contain the 6 values described above but it can be passed as fewer numbers of arguments and in any order. For instance passing (map_width, map_height)
as python tuple is allowed. What is not allowed of course are calculated parameters like the bottom right point of the W.
Output
2 randomly generated integers (x, y) where
$$(0 \leq x \lt \text{map_width}) \land (0 \leq y \lt \text{map_height}) \land[\neg (\text{W_top_left_x} \leq x \lt \text{W_top_left_x} + \text{view_width})\lor \neg (\text{W_top_left_y} \leq y \lt \text{W_top_left_y} + \text{view_height})]$$
holds.
Examples
Input Output(valid random samples)
1000 1000 100 100 600 400 10 10
1000 1000 100 100 600 400 800 550
1000 1000 100 100 600 400 800 10
1000 1000 100 100 600 400 10 550
For details and limitations for input/output please refer to the default input/output rules
2 randomly generated integers (x, y)
\$\endgroup\$