Starting with /\
you can create a Sierpinski triangle like pattern by adding a line beneath such that...
- Any loose branch
/
or\
splits again into two branches:/\
. - Any collision of branches
\/
dies with nothing (but spaces) under it.
Repeating these rules yields
/\
/\/\
/\ /\
/\/\/\/\
/\ /\
/\/\ /\/\
etc...
Write a program or function that takes in a positive integer N and prints the first N lines of this pattern to stdout, with no more leading or trailing spaces than necessary.
For example, if the input is 1
the output must be
/\
If the input is 2
the output must be
/\
/\/\
If the input is 8
the output must be
/\
/\/\
/\ /\
/\/\/\/\
/\ /\
/\/\ /\/\
/\ /\ /\ /\
/\/\/\/\/\/\/\/\
And so on.
The code with the fewest bytes wins.