예제 #1
0
void lookup_window::enter_pressed() {

	output->setText("");

	std::string input_s = input->text().toUtf8().constData();
	
	unsigned int index = input_s.find_last_of(' ');
	
	std::string clue_s = input_s.substr(0, index);
	std::string length_s = input_s.substr(index+1);
	unsigned int length_i = atoi(length_s.c_str());
	
	if (length_i == 0) {
	
		output->setText(QString("Please specifiy length i.e. fleshy red fruit 6"));
		return;
	}

	m_list results = solver_s.lookup_clue(clue(clue_s, length_s), 
		use_dict->isChecked(), use_thes->isChecked(), 
		use_web_wiki->isChecked(), use_web_goog->isChecked(), 
		use_web_clue->isChecked());

	QString output_text;
	output_text += "Total " + QString::number(results.size()) + " words found";

	for (unsigned i = 0; i < results.size(); i++) {
		
		output_text += "\n" + QString::fromStdString(results.get_rank(i)) + 
			"     (" + QString::number(results.get_conf(i)) + ")";
	}
	
	output->setText(output_text);
}
예제 #2
0
파일: FeatureDoor.cpp 프로젝트: Justice-/ia
void Door::playerTryClueHidden() {
  if(isSecret_ && isClued_ == false) {
    const Abilities_t abilityUsed = ability_searching;
    const int PLAYER_SKILL = eng->player->getDef()->abilityVals.getVal(abilityUsed, true, *(eng->player));
    const int BONUS = 10;
    if(eng->abilityRoll->roll(PLAYER_SKILL + BONUS) >= successSmall) {
      clue();
    }
  }
}