-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfractol.c
34 lines (30 loc) · 1.2 KB
/
fractol.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mpauw <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/12/06 18:07:23 by mpauw #+# #+# */
/* Updated: 2018/01/02 11:44:40 by mpauw ### ########.fr */
/* */
/* ************************************************************************** */
#include "fractol.h"
void error(int code)
{
strerror(code);
exit(1);
}
int main(int argc, char **argv)
{
int fractal;
srand(time(NULL));
fractal = 0;
if (argc == 2)
fractal = ft_atoi(argv[1]) - 1;
else if (argc > 2)
error(errno);
if (fractal > AMOUNT_FRAC - 1 || fractal < 0)
fractal = 0;
handle_window(fractal);
}