Im a beginner programmer and im experiencing some issues loading javascript code on my browser. Are there any errors in my code? or could it be an issue with my computer. If it helps: im using OS Sierra, Google Chrome, Atom editor.
Thanks!!
HTML code:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<title>A* Algorithm</title>
<h1>This is the A* pathfinding algorithm</h1>
<script src ="astar.js"> </script>
</body>
</html>
Javascript code:
var cols = 5;
var rows = 5;
var grid = new Array(cols);
function setup() {
createCanvas(400, 400);
console.log("A*");
for (var i = 0; i < cols; i++) {
grid[i] = new Array(rows);
}
for (var i = 0; i < cols; i++) {
for (var j = 0; i < row; j++) {
grid[i][j] = new Spot();
}
}
console.log(grid);
}
function draw () {
background(0);
}