6.3.5: Cmu Cs Academy
They call this a “while-like behavior” because the condition is checked each frame.
circle = None
# Correct pattern for 6.3.5 circle = Circle(50, 200, 20, fill='blue') steps = 0 6.3.5 Cmu Cs Academy
def alternating_colors(rows, cols): grid = [] # This will become a list of rows # Your nested loops here return grid They call this a “while-like behavior” because the
# Arrow key logic if key == 'up': if circle.centerY - speed >= 20: # Keep within top edge circle.centerY -= speed elif key == 'down': if circle.centerY + speed <= 380: # Keep within bottom edge circle.centerY += speed elif key == 'left': if circle.centerX - speed >= 20: # Keep within left edge circle.centerX -= speed elif key == 'right': if circle.centerX + speed <= 380: # Keep within right edge circle.centerX += speed fill='blue') steps = 0 def alternating_colors(rows
To successfully complete 6.3.5, students must understand and apply the following concepts:
The function onMousePress(mouseX, mouseY) provides two built-in variables: mouseX : The horizontal position of the click.