Advertisement
Guest User

pseudo

a guest
Nov 24th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function compareButtonPress(buttonToPress, buttonPressed) {
  2.  
  3. array possibleButtons(space, shift, enter, left, right, up, down, etc.);
  4. int pressedMatch = 0;
  5.  
  6. for (x = 0; x < possibleButtons.length; x++) {
  7. if (possibleButtons(x) == buttonToPress && buttonPressed == buttonToPress) {
  8. pressedMatch++;
  9. } else if (buttonPressed == possibleButtons(x)) {
  10. pressedMatch = pressedMatch + 2;
  11. }
  12. }
  13.  
  14. if (pressedMatch != 1) {
  15. return FALSE;
  16. } else {
  17. return TRUE;
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement