int ft_printf(char *str, ...) { va_list ap; t_numb *e; int cnt; va_start(ap, str); cnt = 0; e = (t_numb*)malloc(sizeof(t_numb)); ft_p3(str, e); if (e->ind1 % 2 == 0) { while (*str != 0) { cnt = cnt + ft_p1(&str, e, ap); ft_p2(&str, e); } } else if (e->ind1 % 2 == 1) cnt = cnt + ft_p4(str, e); va_end(ap); free(e); e = NULL; return (cnt); }
t_tetris *ft_coordinate_check(char *buf, t_tetris *tetris) { int cur; int x_p0; int y_p0; cur = 0; while (buf[cur] != '#') cur++; x_p0 = cur % 5; y_p0 = cur / 5; if (ft_p1(buf, tetris, x_p0, y_p0)) if (ft_p2(buf, tetris, x_p0, y_p0)) if (ft_p3(buf, tetris, x_p0, y_p0)) return (tetris); return (NULL); }
void *ft_wolf(void *tab) { t_indication id; id = *(t_indication *)tab; while (id.x < id.x_next) { ft_p1(&id); ft_p2(&id); ft_p3(&id); ft_p4(&id); ft_show(&id); ft_show_other(&id); id.x++; } return (0); }