| 224 | }; |
| 225 | |
| 226 | function drawCell(xCord, yCord, cell) { |
| 227 | var x = xCord * cellSize; |
| 228 | var y = yCord * cellSize; |
| 229 | |
| 230 | if (cell.n == false) { |
| 231 | ctx.beginPath(); |
| 232 | ctx.moveTo(x, y); |
| 233 | ctx.lineTo(x + cellSize, y); |
| 234 | ctx.stroke(); |
| 235 | } |
| 236 | if (cell.s === false) { |
| 237 | ctx.beginPath(); |
| 238 | ctx.moveTo(x, y + cellSize); |
| 239 | ctx.lineTo(x + cellSize, y + cellSize); |
| 240 | ctx.stroke(); |
| 241 | } |
| 242 | if (cell.e === false) { |
| 243 | ctx.beginPath(); |
| 244 | ctx.moveTo(x + cellSize, y); |
| 245 | ctx.lineTo(x + cellSize, y + cellSize); |
| 246 | ctx.stroke(); |
| 247 | } |
| 248 | if (cell.w === false) { |
| 249 | ctx.beginPath(); |
| 250 | ctx.moveTo(x, y); |
| 251 | ctx.lineTo(x, y + cellSize); |
| 252 | ctx.stroke(); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | function drawMap() { |
| 257 | for (x = 0; x < map.length; x++) { |