ratcatcher/website/levels.php

64 lines
1.2 KiB
PHP

<html>
<title>
nethack.net - ratcatcher level screenshots
</title>
<body bgcolor="#99BB99">
<center>
<br>
<h1>Rat Catcher Levels</h1>
<br>
<table border=1 align=center>
<script language="php">
function getworldname($wld) {
if ($wld == 1) {
return "Forest";
} else if ($wld == 2) {
return "Beach";
} else if ($wld == 3) {
return "Kitchen";
} else if ($wld == 4) {
return "Snow";
}
}
function getworldcolour($wld) {
if ($wld == 1) {
return "#BBDDBB";
} else if ($wld == 2) {
return "#CCCC99";
} else if ($wld == 3) {
return "#9999ff";
} else if ($wld == 4) {
return "#CCCCCC";
}
}
for ($w = 1; $w <= 4; $w++) {
echo "<tr>\n";
printf("<th colspan=4 bgcolor=\"#ffff00\">World %d - %s</th>\n",$w, getworldname($w));
echo "</tr>\n";
for ($l = 1; $l <= 20;) {
echo "<tr>\n";
for ($i = 0 ; $i < 4; $i++) {
printf("<td bgcolor=\"%s\">\n", getworldcolour($w));
echo "<center>\n";
if ($l > 20) {
printf("&nbsp;\n");
} else {
printf("<img src=\"levels/level_%d_%d.png\">\n",$w,$l);
echo "<br>\n";
printf("<b>%d-%d </b>",$w,$l);
passthru("./getname.sh $w $l");
}
echo "</center>\n";
echo "</td>\n";
$l++;
}
echo "</tr>\n";
}
}
</script>
</table>
</html>