It certainly feels like `var score = random()` but I promise it's not XD
It's checking pixel-by-pixel to see if you've got a perfect match with the source image—it's reasonably difficult to pull off until you've gotten some more practice in as you've seen, but it was the best I could do in time for the jam I made it for.
Thanks for playing my game and giving it a try!