Пример #1
0
/**
* A search has been completed. Store the information in the hash.
*
* Currently overwrites existing hash entry regardless of depth.
*/
void HashTable::storeHash(u64 mover, u64 enemy, int alpha, int beta, int score) {
	Hash* entry = hashLoc(mover, enemy);
	if (entry->mover != mover ||entry->enemy != enemy) {
		entry->init(mover, enemy);
	}
	entry->store(alpha, beta, score);
}
Пример #2
0
int _tmain(int argc, _TCHAR* argv[])
{

	Hash *h = new Hash;
	h->init();
	printf("Reading from file...\n");

	FILE * fd = fopen("FILE.TXT", "r"); 

	char str[100];
	while(fscanf(fd, "%s", str) != EOF)
		h->add(str);

	fclose(fd);

	/*printf("Input word which needs to find\n");
	scanf("%s", str);

	HashList *tmp = h->find(str);
	if (tmp)
		printf("words count is %d\n", tmp->count);
	else
		printf("There is no \"%s\"", str);
	*/
	h->printStats();


	delete h;
	scanf("%*s");

	return 0;
}