-
Notifications
You must be signed in to change notification settings - Fork 0
/
console.c
executable file
·51 lines (46 loc) · 1.25 KB
/
console.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* console.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lebojo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/05 14:26:11 by lebojo #+# #+# */
/* Updated: 2023/04/01 23:28:52 by lebojo ### ########.fr */
/* */
/* ************************************************************************** */
#include "inc/proto.h"
int error(char *str)
{
ft_putstr_fd("\033[0;31m[ERROR] \033[0m", 0);
ft_putstr_fd(str, 0);
ft_putchar_fd('\n', 0);
return (1);
}
int info(char *str)
{
ft_putstr_fd("\e[0;32m[", 0);
ft_putstr_fd(NAME_SHORT, 0);
ft_putstr_fd("] \033[0m", 0);
ft_putstr_fd(str, 0);
ft_putchar_fd('\n', 0);
return (1);
}
void print_move(int m)
{
ft_putstr_fd("\e[0;32m[", 0);
ft_putstr_fd("Move", 0);
ft_putstr_fd("] \033[0m", 0);
ft_putnbr_fd(m, 1);
ft_putchar_fd('\n', 1);
}
void print_score(int min, int max)
{
ft_putstr_fd("\e[0;32m[", 0);
ft_putstr_fd("Coins", 0);
ft_putstr_fd("] \033[0m", 0);
ft_putnbr_fd(min, 1);
ft_putchar_fd('/', 1);
ft_putnbr_fd(max, 1);
ft_putchar_fd('\n', 1);
}