The Hilbert curve is a space filling fractal that can be represented as a Lindenmayer system with successive generations that look like this:
Thanks to http://www.texample.net/tikz/examples/hilbert-curve/ for the image.
Goal
Write the shortest program possible (in bytes) that takes a positive integer n from stdin and draws the nth order Hilbert curve to stdout using only forward slash, backward slash, space, and newline.
For example, if the input is 1
the output must be
\
\/
If the input is 2
the output must be
/
\/\
/\ \
/ /\/
\ \
\/
If the input is 3
the output must be
\
/\/
/ /\
\/\ \ \
/\ / / /
/ / \/ \/\
\ \/\ /\ \
\/ / / / /\/
/\/ / \ \
\ \/\ \/
\/\ \
/ /\/
\ \
\/
And so on. (They look nicer if you paste them into something with less line spacing.)
The output should not contain newlines above or below the extremities of the curve, nor any trailing spaces on any lines.