Javascript (ES6), 107 104 100 98 97 91 90 bytes
p=>{s=`/\\`.repeat(p++)+`
`;for(i=p;i>2;s+='\\'+o+o)o=`/ `.repeat(--i)+`
`;return s+'\\/'}
First post here!
Used to useUsed to use Array(len)
.
join(str)
but now usesbut now uses String.repeat(len)
, similar to Ruby's operator*(str,len)
.
Ungolfed:
len => {
var str = `/\\`.repeat(len++) + '\n';
for (var i = len, mid; i > 2; str += '\\' + mid + mid) {
mid = `/ `.repeat(--i) + '\n';
}
return str + '\\/';
}
_Thanks to:_
_107 => 104 bytes: [@insertusernamehere](httphttps://codegolf.stackexchange.com/users/41859/insertusernamehere)_
_97 => 90 bytes: [@user81655](httphttps://codegolf.stackexchange.com/users/46855/user81655)_