Added hasNoMoves to check if game is over