-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfillit.h
More file actions
82 lines (74 loc) · 1.89 KB
/
Copy pathfillit.h
File metadata and controls
82 lines (74 loc) · 1.89 KB
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
76
77
78
79
80
81
82
#ifndef FILLIT_H
# define FILLIT_H
# include <stdlib.h>
# include <unistd.h>
# include <fcntl.h>
#include <stdio.h>
# include "./libft/libft.h"
#define TET_SIZE 21
typedef struct s_type
{
char *shape;
char *name;
struct s_type *next;
} t_type;
typedef struct s_tet
{
t_type *type;
char order;
int x;
int y;
int h;
int w;
struct s_tet *next;
} t_tet;
typedef struct s_lst
{
int size;
t_tet *head;
t_tet *current;
} t_lst;
typedef struct s_map
{
int size;
char **arr;
} t_map;
typedef struct s_types
{
int size;
t_type *head;
t_type *current;
} t_types;
t_tet *new_tet(t_type *type, char order, int x, int y);
t_tet *set_tet(t_tet *tet, char fill, t_map *map, int x, int y);
void unset_tet(t_map *map, t_tet *tet);
int valid_set(t_tet *node, t_map *map, int x, int y);
int is_empty_map(t_map *map);
t_lst *read_in(int fd, char order, t_lst *list, char *buf);
int check_tet(char *tet);
int check_tet2(char *tet);
int check_tet3(char *tet);
char *remove_newlines(char *type_string);
void to_struct(t_lst *list, t_type *type, char order);
t_type *tet_types(char *final_string);
char *tet_string(char *buf);
void create_typelist(void);
int ceil_sqrt(int tet_num);
t_map *new_map(int size);
void free_map(t_map *map);
void set_map_val(t_map *map, int x, int y);
int solve(t_tet *tet, t_map *map);
void print_map(t_map *map);
void print_tets(t_lst *tets);
int is_big_enough(t_map *map, t_tet *tet, int lines);
int check_shape(t_type *type);
void tet_size(t_tet *tet);
void zero_map(t_map *map);
int fill_in(t_tet *tet, t_map *map, int lines, int x, int y, int count);
int process_string(void *buf, t_lst *list, char order);
int first_check(char *buf);
void error_message(void);
char *alloc_buf(void);
int check_doublen(char *buf);
char **ft_strsplit2(char const *s, char c);
#endif