ot;;
for ($Col=1; $Col<=$ColSize; $Col++) {
$nb=0;
for ($i=-1; $i<=1; $i++) {
for ($j=-1; $j<=1; $j++) {
if ($Mine[$Row+$i][$Col+$j] == "1") {
$nb++;
}
}
}
print "<td width=15 height=15 align=center valign=middle>";
if ($Decouv[$Row][$Col]=="1") {
if ($nb==0) {
print " ";
} else {
if ($Mine[$Row][$Col]=="1") {
print "<font color=red>*</font>";
} else {
print "$nb";
}
}
} else {
print "<input type=hidden name=submit value=ok>";
print "<input type=submit name=submit".($Row*($ColSize+1)+$Col)." value=ok>";
}
print "<input type=hidden name=Mine".($Row*($ColSize+1)+$Col)." value=".$Mine[$Row][$Col].">";
print "<input type=hidden name=Decouv".($Row*($ColSize+1)+$Col)." value=".$Decouv[$Row][$Col].">";
print "</td>";
}
print "</tr>";
}
print "</table>";
print "</form>";
?>
<hr>
<form method=post>
行数 :
<input type=text name=RowSize value=5 size=2>
<br>
列数 :
<input type=text name=ColSize value=5 size=2>
<br>
地雷数 :
<input type=text name=NumMine value=4 size=2>
<p>
<input type=submit name=submit value=开始>
<input type=hidden name=generer value=1>
</form>
<p>
<center><font size=-2>(c) 2000, <a href="http://www.phpvault.com">PHPVault</a> - All rights reserved<br>
程序开发<a href="mailto:perso@kidou.net">Kidou</a> </font>
</center>
</body>
</html>