diff --git a/functions_for_cmd_typist.h b/functions_for_cmd_typist.h index 355d146..0769d66 100755 --- a/functions_for_cmd_typist.h +++ b/functions_for_cmd_typist.h @@ -448,4 +448,21 @@ void session_style(unsigned int session_time, unsigned short wrongly_typed,float fprintf(stdout, "\t|ERROR(s):"RED"%d"RESET" TIME: "SPEED_COLOR"%s"RESET" Accuracy: "SPEED_COLOR"%.2f%%"RESET"\n",wrongly_typed,time_conversion,((float) typed-(float)wrongly_typed)/(float) typed*100.0f); fprintf(stdout, "\t|%s"SPEED_COLOR"%.2f"RESET"CPM ~= "GREEN"%.2f"RESET"WPM \n", "AVERAGE SPEED: ",adj_speed,adj_speed/5); fprintf(stdout, "%s\n\n", "\t+---------------------------------------------------------------+"); +} + +extern void write_conf_block_read(unsigned int n)//r is used to record settings for random and standard play +{ + FILE *fconf; + if((fconf=fopen("cmdtypist.conf","rb+"))==NULL) + { + fprintf(stderr, "%s\n", "Fatal Error, Some files are missing"); + exit(EXIT_FAILURE); + } + fseek(fconf,2L,SEEK_SET); + fwrite(&n,sizeof(char),1,fconf); + if(fclose(fconf)) + { + fprintf(stderr, "%s\n", "Fatal Error, Unable to close some files\n"); + exit(EXIT_FAILURE); + } } \ No newline at end of file