Creating the last part of the logic code
Finished the algorithm for checking if the game is won