1- #include "play.h"
1+ #include "./ play.h"
22
33#include "../../libs/Stack/stack.h"
4+ #include "../configuration/main.h"
45#include "../structs.h"
56
6- int playTicTacToe (const int gamesPerPlayer , char * nameOfTheLocalFile ) {
7+ int playTicTacToe (const Configuration * config ) {
78 tStack _ps ;
89 Player _player ;
9- int games = 0 ;
10+ unsigned games = 0 ;
1011
1112 createStack (& _ps );
1213
13- askNamesAndMixPlayers (& _ps ); // this function will return the stack with the players mixed
14+ AskNamesLoadIntoListAndMixItAndLoadIntoAStack (
15+ & _ps ); // this function will return the stack with the players mixed
16+ /* This name is not appropiate, now i dont have one better, but we need to change it
17+
18+ We need to discuss how to do this, but the idea is to ask the names of the players nad load
19+ it into a some structure (list, array, etc), then mix it and load it into a stack (if its
20+ possible)
21+ */
1422
1523 while (grabElementFromStack (& _ps , & _player , sizeof (_player )))
1624 // this function return 1 if its all ok, and 0 if the stack is empty
1725 {
1826 printf ("Hello, Player %s, the game is about to star\n" , _player .name );
19- games = gamesPerPlayer ;
27+ games = config -> gamesPerPlayer ;
2028 while (games > 0 ) {
2129 askPlayerIfHeIsReady (& _player ); // this function will interrogate
2230 // the player if he is ready
@@ -29,13 +37,15 @@ int playTicTacToe(const int gamesPerPlayer, char* nameOfTheLocalFile) {
2937
3038 puts ("You have finished your games" );
3139 printf ("%s, Your final points are: %d \n" , _player .name , _player .points );
32-
33- updateLocalFile (& _player , nameOfTheLocalFile );
34-
35- sendInformationToTheAPI (& _player );
36- // this part of the code may change when we have the API, and how to do it
37- // Also, im not sure if the function is void or int, so we will have to see it later
3840 }
41+ // we need to see how to manage it
42+ /*
43+ updateLocalFile(&_player, nameOfTheLocalFile);
44+
45+ sendInformationToTheAPI(&_player);
46+ this part of the code may change when we have the API, and how to do it
47+ Also, im not sure if the function is void or int, so we will have to see it later
48+ */
3949 return 1 ;
4050}
4151
0 commit comments