In CMU CS Academy’s graphics environment, you would write:
def moveUntilLimit(): global circle while circle.centerX < 300: circle.centerX += 1 # Need a short pause to see animation? # But wait – direct while in graphics will freeze unless stepped.
A common prompt (reconstructed from typical CMU CS Academy content):
If you move the circle off-screen, the autograder can no longer detect it, and the test fails. Always clamp the position within [radius, 400 - radius] .
def onKeyPress(key): circle.centerX += 15 # Error: circle is not defined
In CMU CS Academy’s graphics environment, you would write:
def moveUntilLimit(): global circle while circle.centerX < 300: circle.centerX += 1 # Need a short pause to see animation? # But wait – direct while in graphics will freeze unless stepped.
A common prompt (reconstructed from typical CMU CS Academy content):
If you move the circle off-screen, the autograder can no longer detect it, and the test fails. Always clamp the position within [radius, 400 - radius] .
def onKeyPress(key): circle.centerX += 15 # Error: circle is not defined