PHP - 78 -- <?=($p=' ').'* ';for($s=' 0';$p=substr($p,1);){echo"$p$s ";$s.='00';} For variable heights of 12 or below, modify the hard-coded padding in the above. (Code gets smaller the lower the height) For variable heights of 13 or more use the following, height param is the second argument to `str_pad`. (Code starts at 80 bytes and doesn't grow as fast as the version with static padding) <?=($p=str_pad('',13)).'* ';for($s=' 0';$p=substr($p,1);){echo"$p$s ";$s.='00';} Output of `php -d short_open_tag=1 tree.php` * 0 000 00000 0000000 000000000 00000000000 0000000000000 000000000000000 00000000000000000