Every time you click the button, basically it takes away your score from 100. then, it picks a random number between one and 100-your score. if that random number turns out to be one, you LOSE.
Pretty much all the code is by @xfirelight