|
@ -3,7 +3,10 @@ |
|
|
|
|
|
|
|
|
#define MIN_AGE 12 |
|
|
#define MIN_AGE 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define max_height 10 |
|
|
|
|
|
#define max_width 10 |
|
|
|
|
|
#define unknown_character 'x' |
|
|
|
|
|
#define mine_character '@' |
|
|
|
|
|
|
|
|
typedef enum { |
|
|
typedef enum { |
|
|
SUCCESS, |
|
|
SUCCESS, |
|
@ -19,13 +22,11 @@ typedef enum { |
|
|
PLAYER_O |
|
|
PLAYER_O |
|
|
} Player; |
|
|
} Player; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
typedef struct { |
|
|
Player board[3][3]; // Spielfeld |
|
|
Player board[3][3]; // Spielfeld |
|
|
Player currentPlayer; // Aktueller Spieler |
|
|
Player currentPlayer; // Aktueller Spieler |
|
|
} TicTacToeGame; |
|
|
} TicTacToeGame; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GameResult makeMove(TicTacToeGame* game, int row, int col); |
|
|
GameResult makeMove(TicTacToeGame* game, int row, int col); |
|
|
GameResult checkGameResult(const TicTacToeGame* game); |
|
|
GameResult checkGameResult(const TicTacToeGame* game); |
|
|
GameResult initializeGame(TicTacToeGame* game); |
|
|
GameResult initializeGame(TicTacToeGame* game); |
|
@ -38,15 +39,6 @@ int FieldEmpty(const TicTacToeGame* game, int row, int col); |
|
|
int decideGameType(); |
|
|
int decideGameType(); |
|
|
Player playRockPaperScissors(); |
|
|
Player playRockPaperScissors(); |
|
|
|
|
|
|
|
|
#include <stdio.h> |
|
|
|
|
|
#include <stdlib.h> |
|
|
|
|
|
#include <time.h> |
|
|
|
|
|
|
|
|
|
|
|
#define max_height 10 |
|
|
|
|
|
#define max_width 10 |
|
|
|
|
|
#define unknown_character 'x' |
|
|
|
|
|
#define mine_character '@' |
|
|
|
|
|
|
|
|
|
|
|
int end_check(char** minefield, char** mines, int height, int width); |
|
|
int end_check(char** minefield, char** mines, int height, int width); |
|
|
int field_check(char** minefield, char** mines, int height, int width, int row, int column); |
|
|
int field_check(char** minefield, char** mines, int height, int width, int row, int column); |
|
|
void show_minefield(char** minefield, int height, int width); |
|
|
void show_minefield(char** minefield, int height, int width); |
|
|