0
Your task: given an integer n
, output an embedded triangle to the nth
depth.
Standard methods of input and output, input in any convenient format, output should be as a string. Examples are 0-indexed, you can use 1-indexed if you want. Standard loopholes apply
The left and right sides of each figure is 2^n, when 0 indexed. The top is twice that.
Examples:
n=0
--
\/
n=1
----
\/ /
\/
n=2
--------
\/ / /
\/ /
\ /
\/
This is code-golf, so shortest code wins!
This is NOT a duplicate of the Embedded Hexagons! challenge. I don't think any answers from that question could be trivially copied over to this one.
1@BetaDecay Aww, come on. same author, no big deal. – Matthew Roh – 2017-04-15T12:20:48.370
3Sure, but where does it end? Embedded squares? Embedded Circles? Embedded dodecagons? One challenge IMO is enough – Beta Decay – 2017-04-15T12:23:16.343
5@BetaDecay How does one have an ASCII circle? More to the point, I don't think any answer to the hexagon challenge could be trivially copied over. And what is the problem with similar challenges that are substantially different? If there is one, please let me know. – Comrade SparklePony – 2017-04-15T12:26:23.777
1I'm nominating to reopen this question because I don't see how the hexagon challenge's answers could be trivially copied to this challenge. – HyperNeutrino – 2017-04-15T14:08:14.627
1I'm voting to reopen, as I don't believe they're dupes. However, I've downvoted the challenge. It's kinda boring to have many sets of embedded <x>, and you've got at least 1 more in teh sandbox. – Rɪᴋᴇʀ – 2017-04-15T14:14:46.690