calculateHighscore(duration){
        const MAX_SCORE_DURATION = 1000; // Max duration after which score is not affected
        const SCORE_DURATION_COEFFICIENT = 10;
        let c = 0;
        for (let i = 0; i < this.activeWords.length; i++){
            c += this.activeWords[i].length;
        }
        return Math.ceil(c * Math.max(1, (MAX_SCORE_DURATION - duration) * SCORE_DURATION_COEFFICIENT));
    }
/*
     * Name: calculateHighscore
     * Description: Calculates the highscore of a game based on the duration and length of words
     * Return: Score (int)
    */
calculateHighscore
Description: Calculates the highscore of a game based on the duration and length of words
Return: Score (int)
calculateHighscore Description : Calculates the highscore of a game based on the duration and length of words Return : Score ( int )
calculateHighscore(duration){
        const MAX_SCORE_DURATION = 1000; 
        const SCORE_DURATION_COEFFICIENT = 10;
        let c = 0;
        for (let i = 0; i < this.activeWords.length; i++){
            c += this.activeWords[i].length;
        }
        return Math.ceil(c * Math.max(1, (MAX_SCORE_DURATION - duration) * SCORE_DURATION_COEFFICIENT));
    }
calculateHighscore ( duration ) { const MAX_SCORE_DURATION = 1000 ; const SCORE_DURATION_COEFFICIENT = 10 ; let c = 0 ; for ( let i = 0 ; i < this . activeWords . length ; i ++ ) { c += this . activeWords [ i ] . length ; } return Math . ceil ( c * Math . max ( 1 , ( MAX_SCORE_DURATION - duration ) * SCORE_DURATION_COEFFICIENT ) ) ; }
Name: calculateHighscore
 Description: Calculates the highscore of a game based on the duration and length of words
 Return: Score (int)
Name : calculateHighscore Description : Calculates the highscore of a game based on the duration and length of words Return : Score ( int )
// Max duration after which score is not affected