The learning game - Machine Learning #1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| using namespace std; class Machine { private: unordered_map<unsigned int, int> act; unsigned int __cmd;
public: unsigned int command(unsigned int cmd, unsigned int num) { __cmd = cmd; return get_action(act[__cmd])(num); } void response(bool res) { if(!res) act[__cmd]++; } };
|