Fixed winner-determining method

Moved the check for a tie to have priority over the other cases, so that the computer will not return that it has won, when it actually tied.