etc

small bits of code not worth their own repo
git clone git://git.benoneill.xyz/etc
Log | Files | Refs | README | LICENSE

commit b1ffabc05ff5a0bdef9275bbed7bf7b72302c696
parent d983e1aa24dea291189f5dfe1e4f3dccedc9bbae
Author: Ben O'Neill <ben@benoneill.xyz>
Date:   Tue, 20 Jul 2021 10:21:06 -0400

typetest: cleanup

Diffstat:
Mtypetest.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/typetest.c b/typetest.c @@ -1,16 +1,16 @@ /* - * typetest.c: a simple typing speed test. not super accurate. - * prints a file line by line and has user reproduce the line. - * records WPM, CPM, number of mistakes, total time. + * typetest.c: a simple typing speed test. not very precise. prints a + * given file line by line and has user reproduce each one. records + * WPM, CPM, number of mistakes, and total time. * usage: typetest file + * author: Ben O'Neill <ben@benoneill.xyz> + * license: MIT */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> -const char *sample_test = "Porro molestias eius maiores reprehenderit rerum."; - struct result_s { unsigned int mistakes, total_time, num_words; float average_time; @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) "%f\nWords per minute: %f\nTotal time: %d seconds\n", r.mistakes, ((float) 60) / r.average_time, 60 / ((float) r.total_time / r.num_words), r.total_time); - return 0; + return EXIT_SUCCESS; } /*