Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+7 votes

how should I use the parameter numBubbles in this function?

asked in CSC201 Spring 2021 by (1.1k points)

2 Answers

+5 votes

numBubbles is the number of bubbles you have to create and add to the list.
Therefore, that is the range of the for loop which you create the bubbles.

answered by (1 point)
+1

for numBubbles in range (DEFAULT_BUBBLE_NUM) ?

+1

No, the range should be numBubbles because you will create bubbles for numBubbles times.

+1

So inside the for loop, is it correct to use a function self.circle.draw() to draw bubbles with different positions? Thank you

+1

In the setupBubbles function, you just need to create bubbles and add them to a list. You shouldn't draw them. You will draw them in the main function.

+4 votes

You use numBubble to loop through every bubble you want to create

answered by (1 point)
...