Dense subset has at most one point on each horizontal/vertical line 
Show that there is a dense subset $S$ of $A=[0,1]\times [0,1]$ such that $S$ contains at most one point on each vertical line and at most one point on each horizontal line.

When I think about dense subsets and which contain "not so many" points, the rational numbers come to mind. So if we take $P=\mathbb{Q}\cap[0,1]$, and $S=P\times P$, then we do have the closure of $S$ equal $A$. However, $S$ contains more than one point on each vertical/horizontal line (in fact, infinitely many). How might we adjust so that each horizontal/vertical line contains at most one point in $S$?
 A: Let $\mathscr{I}$ be the set of open intervals in $\Bbb R$ with rational endpoints, let $\mathscr{B}=\{I\times J:I,J\in\mathscr{I}\}$, and let $\mathscr{B}_0=\left\{B\in\mathscr{B}:B\cap\big([0,1]\times[0,1]\big)\ne\varnothing\right\}$; $\mathscr{B}_0$ is a base for the topology of $[0,1]\times[0,1]$. Thus, if $D\subseteq[0,1]\times[0,1]$ has the property that $D\cap B\ne\varnothing$ for each $B\in\mathscr{B}_0$, $D$ must be dense in $[0,1]\times[0,1]$.
$\mathscr{B}_0$ is countable, so we may enumerate it as $\{B_n:n\in\Bbb N\}$, where, say, $B_n=I_n\times J_n$ and $I_n,J_n\in\mathscr{I}$. Choose $D$ recursively, one point at a time, by choosing $p_n=\langle x_n,y_n\rangle\in B_n$ in such a way that for each $n\in\Bbb N$, $x_n\notin\{x_k:k<n\}$ and $y_n\notin\{y_k:k<n\}$, and you’ll have a dense set $D=\{p_n:n\in\Bbb N\}$ with the desired property.
A: I didn't find the duplicate, so here's a construction:
Choose an angle $\alpha$ such that $e^{i\alpha}$ is transcendent. Let $M_0 = \mathbb{Q}\times\mathbb{Q}$ and $M_\alpha$ the set $M_0$ rotated by $\alpha$.
Then $M_\alpha$ has at most one point on every horizontal or vertical line, and is dense in $\mathbb{R}^2$. $M_\alpha \cap [0,\,1]^2$ is dense in $[0,\,1]^2$.
A: Similar to another answer, but not requiring transcendental numbers, and with more elaboration.  Choose a basis of two orthogonal directions with one coordinate rational and the other irrational, e.g. $(1,\sqrt{2})$ and $(\sqrt{2},-1)$.  Consider any two rational points $(q_1,q_2),(r_1,r_2)$.  The slope of the line between these two points is $(r_2 - q_2)/(r_1 - q_1)$, which is rational.  However the slopes of the two orthogonal basis vectors are both irrational, and thus the two rational points cannot line on any common line with either of the two basis vectors' irrational slopes.  Rotations preserve the relationship of a point lying on a line. Thus, if you rotate ${\mathbb Q} \times {\mathbb Q}$ with the rotation $f$ about the origin that carries $(1,\sqrt{2})$ to the direction of $(0,1)$, and carries $(\sqrt{2},-1)$ to the direction of $(1,0)$, then $f({\mathbb Q} \times {\mathbb Q})$ will have no two points on a common horizontal or vertical line, and clearly this set is dense in ${\mathbb R}^2$.  Restricting to $[0,1] \times [0,1]$ gives you the desired dense set.
