I found a bug- The player can't lose if he/she always chooses left. To fix this, change the "3" to a "4" in line 546.