<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
table,td,th
{
border:1px solid black;
}
img
{
width:200px;
height:200px;
}
</style>
</head>
<body>
<?php
session_start();
function abh($nn)
{
$b=array(array(1,3),array(0,2,4),array(1,5),array(0,4,6),array(1,3,5,7),array(2,4,8),array(3,7),array(4,6,8),array(5,7));
foreach ($b as $c=>$d)
{
if(@$nn==$c)
{
foreach ($d as $e)
{
if ($_SESSION['aa'][$e]==9)
{
$_SESSION['aa'][$e]=$_SESSION['aa'][$c];
$_SESSION['aa'][$c]=9;
break;
}
}
break;
}
}
}
$a = array(1,2,3,4,5,6,7,8,9);
if (isset($_GET['ks']))
{
$_SESSION['aa']=$a;
for ($i=0;$i<1000;$i++)
{
$kk=rand(0,8);
abh(@$kk);
}
}
if (!isset($_SESSION['aa']))
{
$a=array(1,2,3,4,5,6,7,8,9);
$_SESSION['aa']=$a;
$h=0;
}
else {$h=1;}
if (@$h){
abh(@$_GET['yd']);
}
$j=1;
?>
<table>
<tr>
<?php
for ($q=0;$q<9;$q++)
{
echo "<td><a href='bb.php?yd=$q'><img src='aa/".$_SESSION['aa'][$q].".png'/></a></td>";
if ($q==2 || $q==5)
{
echo "</tr><tr>";
}
}
?>
</tr>
</table>
<a href="bb.php?ks=1"><h2>新游戏</h2></a>
<?php
foreach($_SESSION['aa'] as $f=>$g)
{
if($g!=$a[$f])
{
$j=0;
break;
}
}
if (@$j==1 && @$h && @$_GET['yd'])
{
echo "<script>alert('成功');location.href='".$_SERVER['PHP_SELF']."'</script>";
}
?>
</body>
</html>
图片我就不上传了,1.png图上显示一个1,2.png图上显示一个2,9.png图上显示空白就可以