= 0 && $x < count($maze) && $y >= 0 && $y < count($maze[0]) && $maze[$x][$y] == "W";
}
// Set maze size
$rows = 10; // Adjust the number of rows
$cols = 10; // Adjust the number of columns
// Generate maze
$generatedMaze = generateMaze($rows, $cols);
// Display the maze
foreach ($generatedMaze as $row) {
foreach ($row as $cell) {
$class = ($cell === "W") ? "wall" : "path";
echo "
";
}
}
?>