1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
string srchSTRbasic( string INPUT )
{
for( int i=0; i < INPUT.length(); i++ ) { INPUT[i] = tolower(INPUT[i]); }
string rtr;
string::size_type Loc;
if( INPUT != "" ) {
// Funcs
if( Loc = INPUT.find("stats", 0) != string::npos ) { return ("stats"); }
else if( Loc = INPUT.find("reset", 0) != string::npos ) { return ("reset"); }
else if( Loc = INPUT.find("restart", 0) != string::npos ) { return ("reset"); }
// Yes, No... Etc
else if( Loc = INPUT.find("yes", 0) != string::npos ) { return ("yes"); }
else if( Loc = INPUT.find("ok", 0) != string::npos ) { return ("yes"); }
else if( Loc = INPUT.find("k", 0) != string::npos ) { return ("yes"); }
else if( Loc = INPUT.find("alright", 0) != string::npos ) { return ("yes"); }
else if( Loc = INPUT.find("y", 0) != string::npos ) { return ("yes"); }
// Up
else if( Loc = INPUT.find("up", 0) != string::npos ) { return ("up"); }
else if( Loc = INPUT.find("ascend", 0) != string::npos ) { return ("up"); }
// Down
else if( Loc = INPUT.find("down", 0) != string::npos ) { return ("down"); }
else if( Loc = INPUT.find("descend", 0) != string::npos ) { return ("down"); }
// Backwards
else if( Loc = INPUT.find("back", 0) != string::npos ) { return ("return"); }
else if( Loc = INPUT.find("return", 0) != string::npos ) { return ("return"); }
else if( Loc = INPUT.find("previous", 0) != string::npos ) { return ("return"); }
else if( Loc = INPUT.find("backwards", 0) != string::npos ) { return ("return"); }
else if( Loc = INPUT.find("south", 0) != string::npos ) { return ("return"); }
else if( Loc = INPUT.find("exit", 0) != string::npos ) { return ("return"); }
// Left
else if( Loc = INPUT.find("left", 0) != string::npos ) { return ("left"); }
else if( Loc = INPUT.find("west", 0) != string::npos ) { return ("left"); }
// Forwards
else if( Loc = INPUT.find("forward", 0) != string::npos ) { return ("forward"); }
else if( Loc = INPUT.find("forwards", 0) != string::npos ) { return ("forward"); }
else if( Loc = INPUT.find("straight", 0) != string::npos ) { return ("forward"); }
else if( Loc = INPUT.find("ahead", 0) != string::npos ) { return ("forward"); }
else if( Loc = INPUT.find("north", 0) != string::npos ) { return ("forward"); }
// Right
else if( Loc = INPUT.find("right", 0) != string::npos ) { return ("right"); }
else if( Loc = INPUT.find("east", 0) != string::npos ) { return ("right"); }
else return ("");
}
else return ("");
}
|