if (the key member function inherited from class wabbit says that the user pressed a key k) { for (search the array of structures using a pointer p) { if (k == p->c) { *dx = p->dx; *dy = p->dy; return; } } punish(); //Punish user who pressed an illegal key. } //Arrive here if the user pressed no key, or pressed an illegal key. *dx = *dy = 0; }