diagonalSelection() {

        if (!this.lastCell || !this.currentCell) { return null; }

        // if successive selected cells are not diagonal, exits returning null
        if (Math.abs(this.currentCell.row - this.lastCell.row) != Math.abs(this.currentCell.col - this.lastCell.col)) { return null; }

        let characterArray = [];

        let dHorizontal = this.lastCell.col <= this.currentCell.col ? 1 : -1;
        let dVertical = this.lastCell.row <= this.currentCell.row ? 1 : -1;

        let row = this.lastCell.row;
        let col = this.lastCell.col;



        while (row != this.currentCell.row + dVertical && col != this.currentCell.col + dHorizontal) {

            let character = this.activeMatrix[row][col];
			characterArray.push({ "row": row, "col": col, "character": character });
			row += dVertical;
			col += dHorizontal;

        }
        return characterArray;
     
    }
/*
     * Checks to see if the user is highlighting the characters
     * in a diagonal line. If they aren't, function will stop
     * user from highlighting characters in a random order
     */
Checks to see if the user is highlighting the characters
in a diagonal line. If they aren't, function will stop
user from highlighting characters in a random order
Checks to see if the user is highlighting the characters in a diagonal line . If they aren ' t function will stop user from highlighting characters in a random order
diagonalSelection() {
        if (!this.lastCell || !this.currentCell) { return null; }
        if (Math.abs(this.currentCell.row - this.lastCell.row) != Math.abs(this.currentCell.col - this.lastCell.col)) { return null; }
        let characterArray = [];
        let dHorizontal = this.lastCell.col <= this.currentCell.col ? 1 : -1;
        let dVertical = this.lastCell.row <= this.currentCell.row ? 1 : -1;
        let row = this.lastCell.row;
        let col = this.lastCell.col;
        while (row != this.currentCell.row + dVertical && col != this.currentCell.col + dHorizontal) {
            let character = this.activeMatrix[row][col];
			characterArray.push({ "row": row, "col": col, "character": character });
			row += dVertical;
			col += dHorizontal;
        }
        return characterArray;
    }
diagonalSelection ( ) { if ( ! this . lastCell || ! this . currentCell ) { return null ; } if ( Math . abs ( this . currentCell . row - this . lastCell . row ) != Math . abs ( this . currentCell . col - this . lastCell . col ) ) { return null ; } let characterArray = [ ] ; let dHorizontal = this . lastCell . col <= this . currentCell . col ? 1 : - 1 ; let dVertical = this . lastCell . row <= this . currentCell . row ? 1 : - 1 ; let row = this . lastCell . row ; let col = this . lastCell . col ; while ( row != this . currentCell . row + dVertical && col != this . currentCell . col + dHorizontal ) { let character = this . activeMatrix [ row ] [ col ] ; characterArray . push ( { "row" : row , "col" : col , "character" : character } ) ; row += dVertical ; col += dHorizontal ; } return characterArray ; }
Checks to see if the user is highlighting the characters
 in a diagonal line.
Checks to see if the user is highlighting the characters in a diagonal line .
// if successive selected cells are not diagonal, exits returning null