values represent the main concern here is to make sure the values are returned in the correct order to match with the interface we established between getinputs and main designing simngames now that we are getting some experience with the top-down design techniquewe are ready to try our hand at the real problemsimngames this one requires bit more thought the basic idea is to simulate games and keep track of how many wins there are for each player well"simulate gamessounds like counted loopand tracking wins sounds like the job for couple of accumulators using our familiar patternswe can piece together an algorithm initialize winsa and winsb to loop times simulate game if playera wins add one to winsa else add one to winsb it' pretty rough designbut then so was our top-level algorithm we'll fill in the details by turning it into python code rememberwe already have the signature for our function def simngames(nprobaprobb)simulates games and returns winsa and winsb we'll add to this by initializing the two accumulator variables and adding the counted loop heading def simngames(nprobaprobb)simulates games and returns winsa and winsb winsa winsb for in range( )the next step in the algorithm calls for simulating game of racquetball ' not quite sure how to do thatso as usuali'll put off the details let' just assume there' function called simonegame to take care of this we need to figure out what the interface for this function will be the inputs for the function seem straightforward in order to accurately simulate gamewe need to know what the probabilities are for each player but what should the output bein the next step of the algorithmwe will need to know who won the game how do you know who wongenerallyyou look at the final score let' have simonegame return the final scores for the two players we can update our structure chart to reflect these decisions the result is shown in figure translating this structure into code yields this nearly completed function