void Monster::you(MsgType type, const vector<string>& param) { string msg; switch (type) { case MsgType::SWING_WEAPON: msg = getCreature()->getName().the() + " swings " + getCreature()->getAttributes().getGender().his() + " " + param.at(0); break; case MsgType::THRUST_WEAPON: msg = getCreature()->getName().the() + " thrusts " + getCreature()->getAttributes().getGender().his() + " " + param.at(0); break; case MsgType::KICK: msg = getCreature()->getName().the() + addName(" kicks", param.at(0)); break; case MsgType::PUNCH: msg = getCreature()->getName().the() + addName(" punches", param.at(0)); break; default: you(type, param.at(0)); return; } if (param.size() > 1) msg += " " + param[1]; if (!msg.empty()) getCreature()->monsterMessage(msg); }
Matrix<double> Gram_Schmidt (Matrix<double> u, Matrix<double> v){ Matrix<double> you(v.getRow(), v.getCol()); //Matrix<double> vt = v.transpose(); //Matrix<double> ut = u.transpose(); Matrix<double> va(1, v.getCol()); Matrix<double> vb(1, v.getCol()); Matrix<double> vc(1, v.getCol()); Matrix<double> vd(1, v.getCol()); for (int i = 0; i < v.getRow(); i++){ if (i == 0){ for (int q = 0; q < v.getCol(); q++){ vd[0][q] = v[i][q]; } double temp1 = magnitude(vd); vd = vd * (1 / temp1); for (int s = 0; s < u.getCol(); s++){ u[i][s] = vd[0][s]; } } else { for (int j = 0; j < v.getCol(); j++){ vb[0][j] = v[i][j]; // vc[0][j] = u[i][j]; vd[0][j] = 0; } for (int k = 0; k < i; k++){ for (int m = 0; m < v.getCol(); m++){ va[0][m] = u[k][m]; } vc = projection (va, vb); vd = vd + vc; } // for (int n = 0; n < vt.getRow(); n++){ // double * vd = vt[n]; // } vd = vd * (-1); vd = vd + vb; double temp = magnitude(vd); vd = vd * (1 / temp); for (int p = 0; p < v.getCol(); p++){ u[i][p] = vd[0][p]; } } //close else } //close i you = u; //v = vt.transpose(); //u = ut.transpose(); return you; } //close GS
void infinite_taunt3(struct mtwist_state *mt, char *buffer, int buflen) { snprintf(buffer, buflen, "%s %s %s %s %s", you(mt), are(mt), adjective(mt), nationality(mt), bad_thing(mt)); }
void infinite_taunt1(struct mtwist_state *mt, char *buffer, int buflen) { snprintf(buffer, buflen, "%s %s %s %s %s %s", you(mt), action(mt), like(mt), adjective(mt), nationality(mt), beast(mt)); }