Exemplo n.º 1
0
int			choose_fractol(t_fractal *p, char *str)
{
	ft_strlower(str);
	if (ft_strequ(str, "julia"))
		init_g_julia(p);
	else if (ft_strequ(str, "mandelbrot"))
		init_g_mandelbrot(p);
	else if (ft_strequ(str, "chromosom"))
		init_g_chromosom(p);
	else if (ft_strequ(str, "rabbit"))
		init_g_noun(p);
	else
		ft_error(INVALID_ARGZ);
	return (1);
}
Exemplo n.º 2
0
char			*ft_uitoa_base(uintmax_t u_value, int base, int up)
{
	char			*result;
	size_t			size;

	if (base < 2 || base > 36)
		return (NULL);
	if (u_value == 0)
		return (zero());
	result = NULL;
	size = find_size(u_value, base, 1);
	result = ft_memalloc(sizeof(char) * (size + 1));
	if (result == NULL)
		return (NULL);
	result[size] = '\0';
	fill_nbr(result, u_value, base, size);
	if (!up)
		ft_strlower(result);
	return (result);
}