Esempio n. 1
0
int main(int argc, char *argv[]){
    int smallest;
    join_route(route, " -> ", ROUTE_SIZE);
    //printf("Len: %d\n", ilen(route));
    for (int i = 0; i < ROUTE_SIZE; i++) {
        char node = getNodeName(route[i]);
        print_routes(node, graph[route[i]]);
        int dist = min(graph[route[i]], &smallest);
        char neighbor = getNodeName(smallest);
        printf("Short distance: %c -> %c: %d\n\n", node, neighbor, dist);
    }
    return 0;
}
Esempio n. 2
0
int					print_shining_ants(t_check *check, char *route)
{
	if (!check->flags || !route)
		return (0);
	if (!ft_strchr(check->flags, 'c'))
		return (0);
	FT_INIT(char **, tmp, ft_strsplit(route, ' '));
	FT_INIT(int, line, 0);
	FT_INIT(char *, to_del, NULL);
	while (tmp && tmp[line])
	{
		to_del = tmp[line];
		tmp[line] = join_route(tmp[line], tmp[line]);
		ft_strdel(&to_del);
		ft_putstr(tmp[line]);
		line++;
	}
	ft_putendl("");
	return (1);
}