Advertisement
Putnam

Family Feud SNES string comparison algorithm

Oct 1st, 2015
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. def dumb_compare(str1,str2):
  2.     cur_compare=0
  3.     for c in str2:
  4.         if c==str1[cur_compare]:
  5.             print(c,cur_compare)
  6.             cur_compare+=1
  7.         if cur_compare==len(str1):
  8.             return True
  9.     return False
  10.  
  11. '''
  12. The most famous example of this is probably the Game Grumps incident where this algorithm was abused. The clue was "things a father buys for his child that he plays with instead" or something along those lines. They guessed CD player. They got it right, as they had answered "model car". A quick run of this algorithm will reveal:
  13.  
  14. dumb_compare('car','cd player')
  15.  
  16. comes out as true, as the letters "c", "a" and "r" show up in order in "cd player".
  17.  
  18. There is a tool-assisted run of the game that shows the exploit much better.
  19. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement