-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchecker.c
78 lines (74 loc) · 2.36 KB
/
checker.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
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* checker.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nhamid <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/18 10:07:42 by nhamid #+# #+# */
/* Updated: 2019/03/18 11:30:03 by nhamid ### ########.fr */
/* */
/* ************************************************************************** */
#include "fractal.h"
void menu(void)
{
ft_putstr("\033[0;34m##################################\n");
ft_putstr("# \033[0mHow To Use\033[0;34m #\n");
ft_putstr("##################################\n");
ft_putstr("# \033[01;33mzoom : scroll Down or Up\033[0;34m #\n");
ft_putstr("# \033[01;33mChange iteration : + or -\033[0;34m #\n");
ft_putstr("# \033[01;33mMove : use Arrows\033[0;34m #\n");
ft_putstr("# \033[01;33mClose : use ESC\033[0;34m #\n");
ft_putstr("# \033[01;33mChange Fractal : use 1 2 3 4\033[0;34m #\n");
ft_putstr("# \033[01;33mChange Color : use C\033[0;34m #\n");
ft_putstr("##################################\n\033[0m");
}
int checker2(t_params *params)
{
if (ft_strcmp(params->str, "Mandelbrot") == 0)
{
ft_init(params);
menu();
params->var = 2;
params->type = 0;
ft_pthread_mandel(params);
}
else if (ft_strcmp(params->str, "Julia") == 0)
{
ft_init(params);
menu();
params->type = 1;
params->ft = 1;
ft_pthread_julia(params);
}
else
return (0);
return (1);
}
void checker(t_params *params)
{
if (checker2(params) == 0)
{
if (ft_strcmp(params->str, "Tricorn") == 0)
{
ft_init(params);
menu();
params->var = -2;
params->type = 2;
ft_pthread_mandel(params);
}
else if (ft_strcmp(params->str, "BurningShip") == 0)
{
ft_init(params);
menu();
params->var = 2;
params->type = 3;
ft_pthread_ship(params);
}
else
{
error_msg();
exit(0);
}
}
}