Skip to content

Instantly share code, notes, and snippets.

@lelandbatey
Created September 18, 2014 17:22
Show Gist options
  • Save lelandbatey/e79eaa8002e43a7c0eb1 to your computer and use it in GitHub Desktop.
Save lelandbatey/e79eaa8002e43a7c0eb1 to your computer and use it in GitHub Desktop.
<?php
echo('<pre>');
function p($i, $l){
for ($x=0;$x<$l; ++$x){
echo(chr($i));}
}
function mk_tree($h=5){
$i=0;$h=1<<$h;$b=$h;
while ($b>1){
$b=$b/2;
for ($i=$b?$h/$b:0;$i;$i--){
p(32,$b-1);p(!($i%2)*32+32,1);}
p(10,1);
}
}
mk_tree();
echo('</pre>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment