42 lines
799 B
C
42 lines
799 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#pragma once
|
|
|
|
#include "config.h"
|
|
|
|
typedef enum {
|
|
PUT,
|
|
POP
|
|
} move_t;
|
|
|
|
typedef struct {
|
|
int player;
|
|
int height [ BOARD_WIDTH ];
|
|
int column [ BOARD_WIDTH ];
|
|
} board_t;
|
|
|
|
typedef struct {
|
|
int vertical2 [ BOARD_WIDTH ];
|
|
int horizontal2 [ BOARD_WIDTH - 1 ];
|
|
int diagonalUp2 [ BOARD_WIDTH - 1 ];
|
|
int diagonalDown2 [ BOARD_WIDTH - 1 ];
|
|
int vertical4 [ BOARD_WIDTH ];
|
|
int horizontal4 [ BOARD_WIDTH - 3 ];
|
|
int diagonalUp4 [ BOARD_WIDTH - 3 ];
|
|
int diagonalDown4 [ BOARD_WIDTH - 3 ];
|
|
} directions_t;
|
|
|
|
typedef struct {
|
|
int total;
|
|
int horizontal;
|
|
int vertical;
|
|
int diagonalUp;
|
|
int diagonalDown;
|
|
} wincount_t;
|
|
|
|
typedef struct {
|
|
wincount_t count0;
|
|
wincount_t count1;
|
|
int win0 [ BOARD_WIDTH ];
|
|
int win1 [ BOARD_WIDTH ];
|
|
directions_t same;
|
|
} wins_t;
|