-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwordle.h
60 lines (54 loc) · 2.03 KB
/
wordle.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* wordle.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: qnguyen <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/23 08:36:25 by qnguyen #+# #+# */
/* Updated: 2022/02/24 16:57:57 by qnguyen ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef WORDLE_H
# define WORDLE_H
# define TOTAL_WORDS 12972
# define FD_SIZE 4096
# define BUFF_SIZE 42
# define GREEN 1
# define YELLOW 2
# define WHITE 3
# include "libft.h"
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
# include <stdio.h>
# include <stdarg.h>
# include <ncurses.h>
# include <string.h>
typedef struct s_win
{
WINDOW *win[30];
WINDOW *win_input;
WINDOW *win_err;
WINDOW *win_main;
WINDOW *win_info;
WINDOW *win_help;
} t_win;
int get_next_line(const int fd, char **line);
/* utilities.c */
int duplicate(char *s, char c);
void check_word(char w_list[TOTAL_WORDS + 1][6], char after_list[TOTAL_WORDS + 1][6], char *word, char *color);
int initializer(char **word, char **color);
void freer(char **word, char **color);
void print_ui(t_win *win, char *s);
void exit_bundle(t_win *win, char *word, char *color);
/*window.c*/
void initialize_window(t_win *win);
void refresh_window(t_win win);
void clear_window(t_win win);
void add_word(int c, t_win win, char *str);
void add_color(int c, t_win win, char *color, char *str);
int check_color_input(char* color);
void initiate_colors();
void initialize_help_box(t_win win);
#endif