-
Notifications
You must be signed in to change notification settings - Fork 0
/
fillit.h
57 lines (49 loc) · 2.09 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
51
52
53
54
55
56
57
/* ************************************************************************** */
/* */
/* :::::::: */
/* fillit.h :+: :+: */
/* +:+ */
/* By: dsaripap <[email protected]> +#+ */
/* +#+ */
/* Created: 2019/05/18 18:09:47 by dsaripap #+# #+# */
/* Updated: 2019/06/19 20:15:34 by ravan-de ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef FILLIT_H
# define FILLIT_H
#include <stdio.h>
#include "libft.h"
#define ANSI_COLOR_CYAN "\x1b[36m"
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_RESET "\x1b[0m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
# define max_width 16
typedef struct s_board
{
uint64_t state;
uint64_t tet;
} t_board;
typedef struct tetr_list
{
unsigned short *tetr;
struct tetr_list *next;
} tetris_list;
void print_list(t_list **tetr_lst);
int read_file(int fd, t_list **tetr_lst);
int ft_recursive(t_board *board, int map_size, uint64_t *tets, int tc);
void ft_putbin(int nb);
void ft_putsquare(unsigned short square);
uint64_t shift_to_topleft(uint64_t num);
void initialize_board(uint16_t **board);
int initial_boardsize(t_list *tetr_lst);
void print_list(t_list **tetr_lst);
int check_neighbours(uint64_t num);
uint64_t tetr_calc(uint64_t j, uint64_t n);
int endline(int num);
void print_binary(uint64_t num, int size);
void print_board(uint16_t *board);
void save_tolist(t_list **tetr_lst, uint64_t num);
int solver(t_list *tetr_lst, uint16_t **board, size_t size);
#endif