Ok, I want to try and do this:
I want a grid, the size of a chess board (8x8). and i want a boolean value for each of the cells.
Also want to be able to display it out easily aswell.
<?php
require_once("./inc/functions.php");
$arrayStart = array(
1 => 0,
2 => 0,
3 => 0,
4 => 0,
5 => 0,
6 => 0,
7 => 0
);
$gridArray = array($arrayStart, $arrayStart);
startUp();
?>
<html>
<head>
<title>
Puzzel With Pawns
</title>
</head>
<body>
<?php
$returnTest = 0;
for ($i=0;$i<=7;$i++){
for ($j=0;$j<=7;$j++){
echo $gridArray[$i][$j];
if (($i = $returnTest) && ($j = 7)){
echo "<BR>";
$returnTest .= 1;
}
}
}
?>
</body>
</html>
Thats my code so far.
<?php
function startUp(){
for ($i=0;$i<=7;$i++){
for ($j=0;$j<=7;$j++){
$gridArray[$i][$j] = 0;
}
}
$gridArray[3][4] = 1;
$gridArray[3][4] = 1;
}
?>
and my include not much in it yet.
Anyway... I'm getting these errors ..
Notice: Undefined offset: 3 in E:\www\pawns\index.php on line 38
Notice: Undefined offset: 0 in E:\www\pawns\index.php on line 46
0000000
Notice: Undefined offset: 0 in E:\www\pawns\index.php on line 46
0000000
Notice: Undefined offset: 2 in E:\www\pawns\index.php on line 46
repeated over n over.
Any suggestions or further pointers?
i realise this is a repeated thread from : http://phpbuilder.com/board/showthread.php?t=10322024
but its marked as resolved - and i dont know how to change that 🙂