Пример #1
0
main(){
	build_database();
	build_hashconstant();
	int i,j,tmp;
	float temp;

    for(i=0;i<HASHTABLESIZE;i++)
        hash[i]=NULL;
	
	scanf("%d",&balls);
	while(balls>0){
		for(i=0;i<BOARDSIZE;i++){
			for(j=0;j<BOARDSIZE;j++){
				scanf("%d",&tmp);
				board.size[j][i]=tmp;
			}
		}
		if(TESTING){
            printf("%f\n",calc());
            continue;
        }
		do{
			level=-1,temp=search();
			printf("%d %d score=%f\n",besty,bestx,temp);
			freememory();
			splash(bestx,besty);
			for(i=0;i<BOARDSIZE;i++){
				for(j=0;j<BOARDSIZE;j++){
					tmp=board.size[j][i];
					printf("%d ",tmp);
				}
				printf("\n");
			}
			scanf("%d",&balls);
		}while(balls>0);
		scanf("%d",&balls);
	}
}
// global variables used: clouds_dir, database_dir
int 
vtree_user::start()
{
	//if init build and save the database
	if (command.compare("/init") == 0)
	{
		build_database(clouds_dir);
		save_database(database_dir);
	}
	//load previously built database and perform recognition
	else if (command.compare("/load") == 0)
		load_database(database_dir);

	//only extract features and save them in a specified images_directory
	else if (command.compare("/features_only") == 0)
	{
		std::vector<FeatureVector> clouds;
		trace_directory(clouds_dir.c_str(), "", clouds, true);	// TODO: What does this do?
	}
	else
		return 1;
	
	return 0;
}