// This script contains all the functions used to manage the checkboard // Setting current colour (each square has a different colour var currentColor = firstCheckerBoardColor; // Saving number of squares filled until now var nSquaresFilled = 0; function fillCheckerboard() { // Getting checkerboard context var context = checkerBoard.context; context.clearRect(0, 0, canvasSize[0], canvasSize[1]); // Cycling through the canvas (using it as a matrix) for (var i=0; i