コード例 #1
0
ファイル: main.c プロジェクト: corentindrouet/Filler
int		main(void)
{
	char	*line;
	char	p[20];
	char	c;
	char	*co;
	t_game	*filler;

	c = 'p';
	line = NULL;
	get_next_line(0, &co);
	c = init_char(co);
	ft_strcpy(p, "5 11\n");
	while (get_next_line(0, &line))
		if (ft_strlen(line) > 0)
		{
			filler = get_data(c, line);
			set_p(p, filler);
			free_filler(&filler);
			write(1, p, ft_strlen(p));
		}
	return (0);
}
コード例 #2
0
ファイル: filler.c プロジェクト: zisson/filler_v2
int	main(void)
{
	t_filler	f;
	char		*line;

	line = NULL;
	if (!init_map(&f, &line))
		return (free_filler(&f, &line));
	if (!my_compute(&f))
		return (free_filler(&f, &line));
	free_grid(&f.form);
	while (1)
	{
		if (!read_grid(&f.grid, &line))
			return (free_filler(&f, &line));
		if (!init_grid(&f.form, &line, PIECE))
			return (free_filler(&f, &line));
		if (!my_compute(&f))
			return (free_filler(&f, &line));
		free_grid(&f.form);
	}
	return (free_filler(&f, &line));
}