<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Amok.dk - Tralala...</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<?php
//Højden på trekanten.
$rows = (isSet($_GET['r']) && is_numeric($_GET['r'])) ? $_GET['r'] : "17" ;
//Pascals Trekant Algoritme.
for($i = 0; $i < $rows; $i++)
for($j = 0; $j <= $i; $j++)
if($j == $i || $j == 0)
$arr[$i][$j] = '1';
else
$arr[$i][$j] = $arr[$i-1][$j-1]+$arr[$i-1][$j];
?>
<center>
<?php
//Udskriver trekanten.
$len = floor(count($arr[$i])/2);
for($i = 0; $i <= count($arr); $i++){
echo "<div style='text-align: center; width: 100%;'>";
for($k = 0; $k <= count($arr[$i])-1; $k++)
echo "<span style='width: 40px; height: 40px; border: 1px solid #000; display: inline-block;'>".$arr[$i][$k]."</span>";
echo "</div>";
}
?>
</center>
<div style='font: bold 14px Verdana;'>Source:</div>
<?php
echo highlight_file(__FILE__, true);
?>
</body>
</html>