Skip to main content
2 of 2
Commonmark migration

PHP, 117 bytes

<?$n=$argv[1];$r=str_repeat;echo$r("/\\",$n);for(;$i++<$n*2-1;)echo"\n".($i%2?"\\":'').$r("/ ",$n-floor(($i-1)/2));?>

Assumes notices are turned off and input is taken from command line.

Ungolfed:

<?php
error_reporting(E_ALL & ~E_NOTICE);

$n = $argv[1];
$r='str_repeat';
echo $r("/\\",$n);
for(;$i++<$n*2-1;){
    echo"\n".(($i%2)?"\\":'') . $r("/ ",$n-floor(($i-1)/2));
}
?>

Comments are welcome :)