-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathequal.php
More file actions
45 lines (42 loc) · 876 Bytes
/
equal.php
File metadata and controls
45 lines (42 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php session_start();
$arrcopy = array();
for($i=0;$i<10;$i++){
$temp = array();
for($j=0;$j<10;$j++){
array_push($temp,$_POST[$i.$j]);
}
array_push($arrcopy,$temp);
}
function printarray($arr){
for($i=1;$i<10;$i++){
for($j=1;$j<10;$j++){
echo $arr[$i][$j];
echo " ";
}
echo "<br>";
}
}
include("home.php");
$arr2 = $_SESSION['arr'];
//printarray($arr2);
function check($arrcopy,$arr2){
for($i=0;$i<10;$i++){
for($j=0;$j<10;$j++){
if($arrcopy[$i][$j] != $arr2[$i][$j]){
return false;
}
}
}
return true;
}
if(check($arrcopy,$arr2)){
echo "yeah you won the puzzle";
echo "<br>";
echo "click on Genrate Crossword to play again";
}
else{
echo "oops! you are wrong";
echo "<br>";
echo "click on Genrate Crossword to try again";
}
?>