and either award points or change the server as appropriate until the game is over we can translate this loose algorithm almost directly into our object-based code firstwe need loop that continues as long as the game is not over obviouslythe decision of whether the game has ended or not can only be made by looking at the game object itself let' just assume that an appropriate isover method can be written the beginning of our play method can make use of this (yet-to-be-writtenmethod def play(self)while not self isover()inside of the loopwe need to have the serving player serve andbased on the resultdecide what to do this suggests that player objects should have method that performs serve after allwhether the serve is won or not depends on the probability that is stored inside of each player object we'll just ask the server if the serve is won or lost if self server winsserve()based on this resultwe either award point or change the server to award pointwe need to change player' score this again requires the player to do somethingnamely increment the score changing serverson the other handis done at the game levelsince this information is kept in the server instance variable of rballgame putting it all togetherhere is our play methoddef play(self)while not self isover()if self server winsserve()self server incscore(elseself changeserver(as long as you remember that self is an rballgamethis code should be clear while the game is not overif the server wins serveaward point to the serverotherwise change the server of coursethe price we pay for this simple algorithm is that we now have two new methods (isover and changeserverthat need to be implemented in the rballgame class and two more (winsserve and incscorefor the player class before attacking these new methodslet' go back and finish up the other top-level method of the rballgame classnamely getscores this one just returns the scores of the two players of coursewe run into the same problem again it is the player objects that actually know the scoresso we will need method that asks player to return its score def getscores(self)return self playera getscore()self playerb getscore(this adds one more method to be implemented in the player class make sure you put that on our list to complete later