Hi all.
I am using Xampp 1.6.6a with Win XP SP2 & 3 (Xampp can be used on a usb stick).
I'm trying to create a basic Connect4 - type game and I'm getting this message back:
Warning: Missing argument 1 for square::__construct(), called in K:\xampp\htdocs\connect4.php on line 31 and defined in K:\xampp\htdocs\connect4.php on line 14
Could not construct
The offending part of the code (it's nearly 500 lines):
class square {
/ Values in the class /
public $player = '0';
/ Methods in the class /
function construct($playerNum) {
$this->player = $playerNum;
}
function setPlayer ($player) {
$this->player = $player;
}
function getPlayer() {
return ($this->player);
}
}
function initializeBoard() {
/ Now we create a multidimensional array which will represent our board. We
will use the class square as a placeholder for the information about
which player's piece is where. Let's start off by creating an array with no
player information. /
for ($rowCounter = 1; $rowCounter <= 6; $rowCounter++) {
for ($colCounter = 1; $colCounter <= 7; $colCounter++) {
$board[$rowCounter][$colCounter] = new square() or die ("Could not create square");
$board[$rowCounter][$colCounter] -> construct($playerNum=0) or die ("Could not construct");
}
}
return $board;
}
All help would be appreciated as I'm tearing my hair out.
TIA.