KaffeeMaus
11 months ago
4 changed files with 160 additions and 11 deletions
-
99src/main/c/Georg/tictactoe.c
-
26src/main/c/Georg/tictactoe.h
-
10src/main/c/main.c
-
36src/test/c/Georg/test_tictactoe.c
@ -1,13 +1,35 @@ |
|||
#ifndef TICTACTOE_H |
|||
#define TICTACTOE_H |
|||
|
|||
#define MAX_INPUT_LENGTH 20 |
|||
#define MAX_COMMANDS 3 |
|||
|
|||
struct ticTacToe{ |
|||
int currentState; |
|||
}; |
|||
|
|||
char* getWelcomeMessage(); |
|||
char* getRulesMessage(); |
|||
// Typdefinition für einen Funktionszeiger |
|||
typedef int (*commandFunction)( int ); |
|||
|
|||
struct command{ |
|||
int id; |
|||
char* description; |
|||
commandFunction fun; |
|||
}; |
|||
|
|||
extern struct ticTacToe GAME; |
|||
extern struct command COMMANDS[MAX_COMMANDS]; |
|||
|
|||
|
|||
void startTicTacToe(); |
|||
char* getWelcomeMessageTicTacToe(void); |
|||
char* getRulesMessageTicTacToe(void); |
|||
struct ticTacToe createTicTacToe(); |
|||
int handleCommand( char* input ); |
|||
|
|||
/* commands */ |
|||
commandFunction getCommandById(int id); |
|||
int startMenu( int code ); |
|||
int startGame( int code ); |
|||
|
|||
#endif //TICTACTOE_H |
Write
Preview
Loading…
Cancel
Save
Reference in new issue