Would a nested conditional = a loop for the CPT?

Hi! I have a few students who are using a nested conditional in their CPT and it works just like a loop. Would that count for the loop requirement on the scoring rubric? Any help is appreciated!

I wouldn’t think so. My guess is that it either doesn’t work just like a loop or it multiplies the complexity by several fold. Perhaps you are looking at recursion? You can show an example if you want a more detailed reply.

Hi! Thanks for your feedback. Here is an example (it’s from CMU CS Academy - I am using the drop in units for my AP class):

app.background = ‘papayaWhip’
app.stepsPerSecond = 20

starA = Star(95, 80, 90, 4, fill =‘lightSeaGreen’)
starB = Star(297, 142, 70, 9, fill = ‘orchid’)
rectA = Rect(27, 264, 165, 130, fill = ‘teal’)
rectB = Rect(275, 229, 90, 140, fill = ‘lavender’)

def onStep():
starA.rotateAngle -= 9
starB.rotateAngle += 3
rectA.rotateAngle -= 2
rectB.rotateAngle += 5

def onKeyPress(key):
if (key == ‘f’):
app.stepsPerSecond *=2
elif (key == ‘s’):
app.stepsPerSecond /=2
elif (key == ‘n’):
app.stepsPerSecond = 20

It continuously spins and seems to work like a loop. Thanks again for any feedback!

That doesn’t count. The spinning stars use a built in loop. The Create Task rules are explicit about built in stuff not counting against the rubric.