Draw a vertical line from top to bottom, dividing the square in half.
Go to the left edge, and halfway up draw a line from left to right. Stop when you reach the vertical line.
Return to the top edge and draw vertical lines at the midpoints of the remaining intervals (at the 1/4 and 3/4 points for the second pass), from top to bottom. If you reach a line, stop, skip to the next line and start again, stopping the next time you reach a line. Repeat until you reach the bottom.
Return to the left edge and draw horizontal lines at the midpoints of the remaining intervals, from left to right. If you reach a line, stop, skip to the next line and start again, stopping the next time you reach a line. Repeat until you reach the right edge.