Closed MalignantCarp closed 2 years ago
Changes done. I also added total sprinting time and average sprint length for the statistics-obsessed. Also truncated the average WPM after 2 decimals places.
Hopefully that fixes my additions. I noticed the average stats were not computing properly. returning total / array.length I believe was re-iterating and distorting the average. I had a total of 96 seconds / 4 should have been 24 but was instead showing up as 4.125 based on the return total / array.length
method, so I made a few tweaks to that. The averages now look correct overall.
So I have added the stats for words added, words deleted, and words net. These don't fully fit at certain resolutions into the end of sprint window without scrolling, so we may need to adjust styling or maybe use a table or some other structure to display the data if we're keeping all the stats there. Technically, words net should equal the total words written that you originally calculated.
I didn't add them to the leaf as a) I have no idea how to do that and b) I feel like loading up a bunch of numbers that are going to change regularly as you type might get distracting.
Also made it so that when you update the settings for sprint length, it updates the timer on the leaf and that the update also updates the millisecondsLeft, which is used for the miniStats.
Replaced an if statement with a math equation instead for averageWPM, though I realize that is trivial as the function isn't called on a regular basis so the processing overhead is negligible.