Beispiel #1
0
void search_for_word(V_NODE *head)
{
	char word[WORD_LEN];

	while(1)
	{
		puts("Please input the word:(input 1 to quit)");
		fgets(word, WORD_LEN-1, stdin);		
		if(word[0] == '1')
		{
			break;
		}
		if(word[strlen(word) - 2] == '*')
		{
			word[strlen(word) - 2] = '\n';
			word[strlen(word) - 1] = '\0';
			print_similar(head, word);
		}
		else
		{
			if(search3(head, word) < 0)
			{
				print_similar(head, word);
			}
		}			

	}		
}
Beispiel #2
0
bool cCharStuff::cBankerAI::DoAI(int c, P_CHAR pBanker, const QString& comm)
{
	P_CHAR pc_currchar = currchar[c];

	string search2("BALANCE");
	string search3("WITHDRAW") ;
	string search4("CHECK") ;

	if (SrvParams->useSpecialBank())
	{
		if ((comm.contains(SrvParams->specialBankTrigger(), false)) &&(!(pc_currchar->dead)))
		{
			openspecialbank(c, currchar[c]);
			return true;
		}
	}
    else if ((comm.contains("BANK")) &&(!(pc_currchar->dead)))
	{
		OpenBank(c);
		return true;
	}
    else if ((comm.contains("BALANCE")) &&(!(pc_currchar->dead)))
	{
		return Balance(c, pBanker);
	}
	else if ((comm.contains("WITHDRAW")) &&(!(pc_currchar->dead)))
	{
		return Withdraw(c, pBanker, comm.latin1());
	}
	else if ((comm.contains("CHECK")) &&(!(pc_currchar->dead)))
	{
		return BankCheck(c, pBanker, comm.latin1());
	}
	return true;
}