2023-05-16 11:03:51 +02:00
|
|
|
#ifndef FORZA4_H
|
|
|
|
#define FORZA4_H
|
|
|
|
|
|
|
|
#include <structures.h>
|
|
|
|
|
2023-05-16 16:55:56 +02:00
|
|
|
#define ORIZONTAL 1
|
|
|
|
#define VERTICAL _COLLUMS
|
|
|
|
#define DIAGONAL _COLLUMS - 1
|
|
|
|
#define DIAGONAL_INV _COLLUMS + 1
|
|
|
|
|
|
|
|
#define isValid(pos) (pos > 0 && pos / _COLLUMS < _ROWS)
|
|
|
|
|
|
|
|
// global variable
|
|
|
|
static int _ROWS;
|
|
|
|
static int _COLLUMS;
|
|
|
|
|
2023-05-17 15:04:42 +02:00
|
|
|
static char _TOKEN1;
|
|
|
|
static char _TOKEN2;
|
2023-05-16 11:03:51 +02:00
|
|
|
|
|
|
|
void setCollums(int collums);
|
2023-05-17 10:42:16 +02:00
|
|
|
void setRows(int rows);
|
2023-05-16 11:03:51 +02:00
|
|
|
int getIndex(int i, int j);
|
2023-05-16 11:45:16 +02:00
|
|
|
|
2023-05-17 15:04:42 +02:00
|
|
|
int checkWin(tile_t *board, int pos);
|
|
|
|
int checkWinAll(tile_t *board);
|
|
|
|
|
|
|
|
void printBoard(tile_t *board);
|
|
|
|
void printTile(tile_t t);
|
2023-05-16 11:03:51 +02:00
|
|
|
|
|
|
|
#endif
|