Skip to content

Commit

Permalink
duck typist: change wpm computation to the de facto standard (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
TeXitoi authored Sep 20, 2024
1 parent 77af8b0 commit c319f60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/duck-typist.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ window.addEventListener('DOMContentLoaded', () => {
const words = gLesson.querySelectorAll('.space').length + 1;
const chars = gLesson.children.length;
const cpm = Math.round(chars / elapsed);
const wpm = Math.round(words / elapsed);
const wpm = Math.round(cpm / 5);
const prc = 100 - Math.round(1000 * errors / chars) / 10;
gStatus.innerHTML = `${wpm} wpm, ${cpm} cpm <progress value="${cpm}" max="${MIN_CPM_SPEED}">${cpm}</progress>, ${prc} % <progress value="${prc}" max="${MIN_PRECISION}">${prc}%</progress>`;

Expand Down

0 comments on commit c319f60

Please sign in to comment.