Skip to content

Commit a471943

Browse files
committed
Some changed about Lucas's comments
1 parent d45a861 commit a471943

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

.github/workflows/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Explain to us what you were expecting from the program result after you introduc
1717

1818
### SCREENSHOTS OR FILE THAT SUPPLY EVIDENCE
1919

20-
2120
If you could, please attach the log error or a screenshot
2221

2322
### ADDITIONAL INFORMATIONl

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "./configuration/main.h"
88
#include "./macros.h"
9-
#include "./play.h"
9+
#include "./play/play.h"
1010
#include "./structs.h"
1111
#include "./utilities.h"
1212

src/play/play.c

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
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

src/structs.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ typedef struct {
1818
char name[PLAYER_NAME_LENGTH]; // TODO: use a dynamic method.
1919
size_t points;
2020
char assignedForm;
21-
size_t remainingTurns;
22-
char Turn; // it will be easer to use a char to represent the turn and having this here
21+
// size_t remainingTurns;
22+
unsigned char
23+
Turn; // it will be easer to use a char to represent the turn and having this here
2324
} Player;
2425

2526
typedef struct {

0 commit comments

Comments
 (0)