Begin implementation of stats

This commit is contained in:
Aidan Haas
2022-12-17 23:35:29 -05:00
committed by GitHub
parent 2d09187508
commit 3d72f4a7dd
3 changed files with 58 additions and 2 deletions
+30
View File
@@ -73,6 +73,36 @@ int parse_words_file(FILE *words_file, Word_array *words) {
return SUCCESS;
}
/* Creates empty stats file */
int create_stats_file(FILE *stats_file) {
/* Numerical Stats */
fputs("Best WPM: 0\n", stats_file);
fputs("10w: 0\n", stats_file);
fputs("25w: 0\n", stats_file);
fputs("50w: 0\n", stats_file);
fputs("100w: 0\n", stats_file);
fputs("Tests completed: 0\n", stats_file);
/* Dynamic Stats (Used for calculating average WPM, Accuracy, etc) */
fputs("Characters typed: 0\n", stats_file);
fputs("Characters correct: 0\n", stats_file);
fputs("Time typed: 0\n", stats_file);
fclose(stats_file);
return SUCCESS;
}
int load_stats(FILE *stats_file, Stat_struct *stats) {
/* Placeholder */
}
int save_stats(FILE *stats_file, Stat_struct *stats) {
/* Placeholder */
fclose(stats_file);
}
/* Appends first parameter to the end of end of the second parameter
(Does not change size of the target, assumes there is space) */
void append_line(char *source, char *target) {