Beispiel #1
0
int	read_arg(t_tetris *tetris, int ac, char **av)
{
  int   i;
  int   n;
  int   debug;

  i = 0;
  n = 0;
  debug = 0;
  while (++i < ac)
    {
      if (my_strcmp(av[i], "-d") == 0 || my_strcmp(av[i], "--debug") == 0)
	debug = 1;
      else if (my_strcmp(av[i], "--help") == 0 && ac == 2)
	display_help(av[0]);
      else
	if ((n = check_good_arg(tetris, av, &i)) == -1)
	  return (-1);
      if (n == 1)
	{
	  my_putstr_error("Wrong arguments\n\n");
	  display_help_error();
	}
      }
  if (display_debug(tetris, debug) == -1)
    return (-1);
  return (0);
}
int main(int argc, char const *argv[])
{
	if(argc<2)
		return 1;
	struct Graph *map=read_map(argv[1]);
	display_debug(map);

	return 0;
}
int main(int argc, char const *argv[])
{
	if(argc==1){
		printf("argv NULL!\n");
		return (1);
	}
	struct Graph *map=read_map(argv[1]);
	display_debug(map);
	depth_first_search(map);
	return 0;
}
int main(int argc, char const *argv[])
{
	if(argc==1){
		printf("argv NULL!\n");
		return (1);
	}
	int nodesize;
	int **map=read_map(argv[1],&nodesize);
	display_debug(map,nodesize);
	depth_first_search(map,nodesize);
	return 0;
}
void basemethod(int **map,int nodesize){
	for(int i=0;i<nodesize;i++)
		for(int j=0;j<nodesize;j++)
			if(i!=j && !map[i][j])
				map[i][j]=SHRT_MAX;
	int **nextmatrix=map;
	int i=1;
	while(i<nodesize-1){
		nextmatrix=getnextmatrix(nextmatrix,nodesize,nextmatrix);
		i*=2;
	}
	display_debug(nextmatrix,nodesize);
	//for(int i=2;i<=nodesize-1;i++)
	//	nextmatrix=getnextmatrix(nextmatrix,nodesize,map);
	//display_debug(nextmatrix,nodesize);
}