-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfillit.h
50 lines (42 loc) · 1.48 KB
/
fillit.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fillit.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rhallste <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/10/27 14:35:15 by rhallste #+# #+# */
/* Updated: 2017/11/18 14:52:30 by rhallste ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FILLIT_H
# define FILLIT_H
# include <string.h>
# define ERROR_RETURN(i) { ft_putendl("error"); return (i); }
# define BUFF_SIZE 545
enum
{
PASS = 0,
ARG_ISSUE = 1,
INPUT_ISSUE = 2,
SOLVE_ISSUE = 3
};
typedef struct s_piece
{
int shape;
size_t width;
size_t height;
char id;
int position;
} t_piece;
typedef struct s_map
{
int size;
long long placement;
} t_map;
t_piece **get_pieces(int fd);
long long modify_shape_to(t_piece *piece, int map_size, int pos);
int validate_input(char *input);
int try(t_piece **pieces, t_map *map);
char *solve(t_piece **pieces);
#endif