Squares Fixed by Endres (uncompressed -> look at it XD)

<?$z=substr;do{if($x!=$a||!$c){$x=fgets(STDIN);$a=rtrim($x);}$c='';for($j=0;$j<=strlen(max($a,$b))+1;$j++){$m=$z($b,$j,1)=='.';$l=$z($b,$j-1,1)=='.';$r=$z($a,$j+1).$z($b,$j+1)>'';if($z($a,$j,1)=='.')$c.=!$m&&(!$l||$j<1)?' _':'|_';elseif($m)$c.='|_';elseif($l&&$j>0)$c.=$r?'| ':'|';elseif($r)$c.='  ';}echo"$c\x0d
";$b=$a;}while($c);

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page