";
if(is_numeric($xyset)){
echo '';
$var = array_fill(0, ($col+1), 1);
$binvar = $var;
$i = 0;
while($i < $row){
$j = 1;
while($j < $col){
$binvar[$j] = (($var[$j] +1) / 2);
echo "$binvar[$j]";
$var[$j] = ($var[$j] * $var[$j+1]);
$j++;
}
// * This bit will mirror the triangle so you get more of a pyramid, symmetrical left-right, but a better option is to replace 1 with if it is to the right of any 0, and with a space if it's to the left of a zero and put the whole thing in a
if(isset($_POST['sym'])){
$k = $col;
while($k > 1){
echo $binvar[$k--];
}
}
$var[$j] *= -1;
echo '0
';
$i++;
} //end check for $xyset
}
?>