correction final historique partie

This commit is contained in:
Dylan LANDRIN 2024-10-25 22:35:10 +02:00
parent 16f081c454
commit 5970b43f61
2 changed files with 13 additions and 7 deletions

View File

@ -54,13 +54,12 @@ void save_party(char * status, const char * good_word, char try[], int cpt_try,
char * date;
date = ctime(&t); //stock the current time format as: day, month, number of the month, hour, year
FILE* fichier = fopen("save_party.txt", "w");
FILE* fichier = fopen("save_party.txt", "a");
if (fichier != NULL)
{
fputs("Date and time: ", fichier);
fputs(date,fichier);
fputs("\n",fichier);
fputs("Status: ", fichier);
fputs(status,fichier);
@ -81,6 +80,7 @@ void save_party(char * status, const char * good_word, char try[], int cpt_try,
fputc(good_try[i],fichier);
}
fputs("\n",fichier);
fputs("\n",fichier);
fclose(fichier); // Close the opened file
}

View File

@ -1,6 +1,12 @@
Date and time: Fri Oct 25 18:32:50 2024
Status: Win
Date and time: Fri Oct 25 22:29:13 2024
Status: Lose
Good word: koala
tried letters: sf
guessed letters: akol
tried letters: zertyu
guessed letters: a
Date and time: Fri Oct 25 22:29:40 2024
Status: Win
Good word: code
tried letters: a
guessed letters: code