clickSquare(square){

		// If the game is not started then start the game
		if (!this.started){
			this.startedTime = Math.round(new Date().getTime() / 1000);
			this.started = true;
		}

		// Square must be either of type 'unknownsquare' or in the circumstances of a game being over a flagsquare is also allowed
		if (!(square.classList.contains("unknownsquare")) && !(this.gameOver && square.classList.contains("flagsquare"))){
			return;
		}

		// Square once clicked is no longer unknown
		square.classList.remove("unknownsquare");

		// Incase user clicks on bomb (the !gameOver part is for revealing the entire board)
		if (inArray(this.bombLocations, square.id)){
			// If game is over then this is a flag square needs to be removed to allow bomb image
			if (this.gameOver){
				square.classList.remove("flagsquare");
			}
			square.classList.add("bombsquare");
			if (!this.gameOver){
				this.endGame();
			}
			return;
		}

		let squareRow = this.getRow(square.id);
		let squareCol = this.getCol(square.id);
		let bombsNear = this.countBombsNear(squareRow, squareCol);
		
		// When no bombs near a square then nearby squares can be cleared
		if (bombsNear == 0){
			this.clearNearBy(squareRow, squareCol);
		}

		// Else add number of bombs
		square.classList.add("bombsnear" + bombsNear.toString());
		if (!this.gameOver){
			this.checkGameOver()
		}
	}
/*
     * Name: clickSquare
     * Description: Handles the action of clicking on a square
     * Return: None
    */
clickSquare
Description: Handles the action of clicking on a square
Return: None
clickSquare Description : Handles the action of clicking on a square Return : None
clickSquare(square){
		if (!this.started){
			this.startedTime = Math.round(new Date().getTime() / 1000);
			this.started = true;
		}
		if (!(square.classList.contains("unknownsquare")) && !(this.gameOver && square.classList.contains("flagsquare"))){
			return;
		}
		square.classList.remove("unknownsquare");
		if (inArray(this.bombLocations, square.id)){
			if (this.gameOver){
				square.classList.remove("flagsquare");
			}
			square.classList.add("bombsquare");
			if (!this.gameOver){
				this.endGame();
			}
			return;
		}
		let squareRow = this.getRow(square.id);
		let squareCol = this.getCol(square.id);
		let bombsNear = this.countBombsNear(squareRow, squareCol);
		if (bombsNear == 0){
			this.clearNearBy(squareRow, squareCol);
		}
		square.classList.add("bombsnear" + bombsNear.toString());
		if (!this.gameOver){
			this.checkGameOver()
		}
	}
clickSquare ( square ) { if ( ! this . started ) { this . startedTime = Math . round ( new Date ( ) . getTime ( ) / 1000 ) ; this . started = true ; } if ( ! ( square . classList . contains ( "unknownsquare" ) ) && ! ( this . gameOver && square . classList . contains ( "flagsquare" ) ) ) { return ; } square . classList . remove ( "unknownsquare" ) ; if ( inArray ( this . bombLocations , square . id ) ) { if ( this . gameOver ) { square . classList . remove ( "flagsquare" ) ; } square . classList . add ( "bombsquare" ) ; if ( ! this . gameOver ) { this . endGame ( ) ; } return ; } let squareRow = this . getRow ( square . id ) ; let squareCol = this . getCol ( square . id ) ; let bombsNear = this . countBombsNear ( squareRow , squareCol ) ; if ( bombsNear == 0 ) { this . clearNearBy ( squareRow , squareCol ) ; } square . classList . add ( "bombsnear" + bombsNear . toString ( ) ) ; if ( ! this . gameOver ) { this . checkGameOver ( ) } }
Name: clickSquare
 Description: Handles the action of clicking on a square
 Return: None
Name : clickSquare Description : Handles the action of clicking on a square Return : None
// If the game is not started then start the game // Square must be either of type 'unknownsquare' or in the circumstances of a game being over a flagsquare is also allowed // Square once clicked is no longer unknown // Incase user clicks on bomb (the !gameOver part is for revealing the entire board) // If game is over then this is a flag square needs to be removed to allow bomb image // When no bombs near a square then nearby squares can be cleared // Else add number of bombs