Implemented hasWon() method which checks if the player has won the game
or not.