-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiller.h
75 lines (69 loc) · 2.55 KB
/
filler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* filler.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ydeineha <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/22 14:31:28 by ydeineha #+# #+# */
/* Updated: 2018/05/22 14:31:32 by ydeineha ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FILLER_H
# define FILLER_H
# define BOARD 1
# define PIECE -1
# define ALT 1
# include "./libft/libft.h"
typedef struct s_coord
{
int i;
int j;
} t_coord;
typedef struct s_brd
{
int i;
int j;
//t_coord size;
char **brd;
char **tmp;
} t_brd;
typedef struct s_chr
{
char me;
char enemy;
} t_chr;
typedef struct s_filler
{
int **map;
t_coord size;
int first;
int count;
t_coord goal1;
t_coord goal2;
t_coord touch;//new
t_coord en;
t_chr player;
} t_filler;
t_brd *create_board(char *line);
void fill_board(char **board, char *line, int *type);
void put_piece(t_brd *board, t_brd **piece, int player);
void create_game(t_filler *game, t_brd *board, int player);
void set_fin_goals(t_filler *game, t_brd *board, int player);
t_coord *find_goal(t_coord pt, t_brd *board, t_filler *game);
int dst_mnh(t_coord a, t_coord b);
t_coord *set_edge(int i, int j);
void goal_for_pt(t_filler *game, t_coord *goal, t_coord *edge, t_coord pt);
void set_goal(t_filler *game, t_coord *goal, t_coord *edge, t_coord pt);
void compare_goals(t_filler *game, t_coord *goal_new);
void clean_map(t_filler *game);
void write_max_dst(t_filler *game, t_coord *goal_new);
t_coord find_point(t_filler *game, t_brd *board, t_brd *piece);
int check_piece(t_filler *game, t_brd *board, t_brd *piece, t_coord pt);
void clean_board(t_brd **board);
void set_point(t_filler *game, t_coord tmp, t_coord *point, int *min);
void set_count(t_filler *game, t_brd *board, t_brd *piece, t_coord pt);
int check_count(t_filler *game, t_coord point);
void change_board(t_filler *game, t_brd *board);
char **copy_board(t_brd *board, char **brd);
#endif