@@ -19,7 +19,7 @@ unsigned char playTicTacToe(const Configuration* config, char* localFilePath) {
1919    newList (& playersAfterMatch );
2020
2121    if  (!requestPlayerNames (& players )) {
22-         printf ("> Error! An error occurred on get player names." );
22+         printf ("> Error! An error occurred on get player names.\n\n " );
2323        return  0 ;
2424    };
2525
@@ -28,22 +28,19 @@ unsigned char playTicTacToe(const Configuration* config, char* localFilePath) {
2828    while  (popElement (& players , & player , sizeof (player ))) {
2929        printf ("> Hi %s, now it's your turn to play...\n\n" , player .name );
3030
31+         isPlayerReady (& player );
32+ 
3133        games  =  config -> gamesPerPlayer ;
3234        while  (games  >  0 ) {
3335            printf ("> %d games remaining...\n\n" , games );
3436
35-             isPlayerReady (& player );
3637            playGame (& player );  //  TODO 
3738
3839            games -- ;
3940        }
4041
4142        printf ("> You won/lose the match! Your final score is %d.\n\n" , player .points );
4243
43-         printf ("> " );
44-         system ("pause" );
45-         puts ("" );
46- 
4744        if  (!pushElement (& playersAfterMatch , & player , sizeof (player ))) return  0 ;
4845    }
4946
@@ -56,6 +53,8 @@ unsigned char playTicTacToe(const Configuration* config, char* localFilePath) {
5653        return  0 ;
5754    };
5855
56+     puts ("> The game statistics was sent to the API.\n" );
57+ 
5958    if  (createLocalRecord (config , & playersAfterMatch , localFilePath )) {
6059        puts ("> Error! An error occurred on create local record.\n\n" );
6160
@@ -65,5 +64,7 @@ unsigned char playTicTacToe(const Configuration* config, char* localFilePath) {
6564        return  0 ;
6665    };
6766
67+     puts ("> The game statistics was saved as a local report.\n" );
68+ 
6869    return  1 ;
6970}
0 commit comments