Skip to content

Commit 9bf583a

Browse files
authored
[feature] Game logic and implementation (#22)
2 parents c5acf8b + ab85b7f commit 9bf583a

File tree

10 files changed

+780
-46
lines changed

10 files changed

+780
-46
lines changed

src/configuration/macros.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@
55

66
#define CONFIGURATION_LINE_LENGTH 256
77

8+
// POINTS
9+
#define VICTORY 3
10+
#define TIE 2
11+
#define DEFEAT -1
12+
813
#endif // SRC__CONFIG_MACRO_H_INCLUDED

src/play/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
#include "../api/main.h"
77
#include "../configuration/main.h"
88
#include "../structs.h"
9+
#include "./tateti/main.h"
910
#include "./utilities.h"
1011

1112
unsigned char playTicTacToe(const Configuration* config, char* localFilePath) {
1213
List players;
1314
List playersAfterMatch;
1415

1516
Player player;
17+
1618
unsigned games = 0;
1719

1820
newList(&players);
@@ -39,7 +41,11 @@ unsigned char playTicTacToe(const Configuration* config, char* localFilePath) {
3941
games--;
4042
}
4143

42-
printf("> You won/lose the match! Your final score is %d.\n\n", player.points);
44+
printf("> Your final score is %d.\n\n", player.points);
45+
46+
printf("> ");
47+
system("pause");
48+
puts("");
4349

4450
if (!pushElement(&playersAfterMatch, &player, sizeof(player))) return 0;
4551
}

0 commit comments

Comments
 (0)