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
|
|
|
|
|
2023-05-23 15:47:34 +02:00
|
|
|
extern tile_t *_BOARD;
|
2023-05-23 15:41:23 +02:00
|
|
|
|
2023-05-16 16:55:56 +02:00
|
|
|
// global variable
|
2023-05-29 11:37:43 +02:00
|
|
|
extern int _ROWS;
|
|
|
|
extern int _COLLUMS;
|
2023-05-16 16:55:56 +02:00
|
|
|
|
2023-05-29 11:37:43 +02:00
|
|
|
extern char _TOKEN1;
|
|
|
|
extern 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-23 12:35:25 +02:00
|
|
|
void setTokens(char t1, char t2);
|
2023-05-16 11:03:51 +02:00
|
|
|
int getIndex(int i, int j);
|
2023-05-16 11:45:16 +02:00
|
|
|
|
2023-05-31 11:00:59 +02:00
|
|
|
int checkWin(int pos);
|
|
|
|
int checkWinAll();
|
|
|
|
int checkMove(int collums);
|
2023-05-17 15:04:42 +02:00
|
|
|
|
2023-05-31 11:00:59 +02:00
|
|
|
void printBoard();
|
2023-05-17 15:04:42 +02:00
|
|
|
void printTile(tile_t t);
|
2023-05-31 11:00:59 +02:00
|
|
|
void insertMove(int pos, int turn);
|
2023-05-22 17:22:17 +02:00
|
|
|
|
|
|
|
int isValid(int pos);
|
2023-05-16 11:03:51 +02:00
|
|
|
|
2023-06-18 16:13:05 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/************************************
|
|
|
|
*VR471576
|
|
|
|
*Lorenzo Bianchi
|
|
|
|
*16/06/2023
|
|
|
|
*************************************/
|