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 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1},
			{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1},
			{1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1},
			{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1},
			{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
			{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		};
	ft_copy_tab(map_1, e);
}
Example #2
0
void		ft_get_map(t_wolf *wolf)
{
	if (wolf->map != NULL)
		free(wolf->map);
	ft_copy_tab(g_map, wolf);
	get_start_pos(g_map, wolf);
}
Example #3
0
File: main.c Project: Apercu/42sh
int					main(int ac, char **av, char **env)
{
	t_ctx	*ctx;

	ctx = CTX;
	(void)ac;
	(void)av;
	ctx = CTX;
	ft_term_init();
	setup_signal();
	ft_copy_tab(&ctx->env, env);
	ft_load_history(ctx, 0, NULL, NULL);
	ft_aff_prompt();
	ft_loop();
	ft_reset_term();
	return (0);
}
Example #4
0
File: main.c Project: aoll/sh
int				main(int ac, char **av, char **envs)
{
	char	*line;
	int		red;
	char	**env;

	av = av;
	env = ((envs[0]) ? ft_copy_tab(envs) : NULL);
	signal(SIGINT, sig);
	while (42)
	{
		ft_putstr("$>");
		if ((red = get_next_line(0, &line)))
		{
			if ((ft_strlen(line)) > 0)
			{
				env = mainter(ac, env, line);
			}
			((red < 0) ? exit (0) : 0);
		}
		((red == 0) ? (ft_putchar('\n'), exit (0)) : 0);
	}
	return (0);
}