Before we dissect the specific exercise, let's establish the platform. CMU CS Academy is a free, online, project-based curriculum developed by Carnegie Mellon University. It uses a custom, simplified version of Python (built around the cmu_graphics library) to teach computer science fundamentals through visual, interactive graphics.
Unlike text-based problems on LeetCode or Codecademy, CMU CS Academy asks you to build shapes, animate objects, and respond to user input (mouse clicks and keyboard presses) within a 400x400 canvas.
While the exact prompt can vary slightly between the CS0 and CS1 tracks, the standard description for 6.3.5 is as follows: 6.3.5 Cmu Cs Academy
"Create a blue circle with a radius of 20 at position (200, 200). Use the
onKeyPresshandler to move the circle left, right, up, and down when the corresponding arrow keys are pressed. The circle should move 15 pixels per key press."
Sometimes, the exercise involves moving a rectangle, changing colors on a keypress (e.g., pressing "r" for red, "b" for blue), or printing the key name to the console. However, the most common version is arrow key movement. Before we dissect the specific exercise, let's establish
The primary goal of 6.3.5 is to bridge the gap between backend data processing and frontend visual output. Students are usually tasked with reading a CSV (Comma Separated Values) file and plotting the data using a Bar Chart, Line Graph, or Scatter Plot.
This exercise reinforces the idea that coding is a tool for problem-solving. Instead of just drawing shapes, students are drawing shapes based on external, real-world variables. "Create a blue circle with a radius of
If the CMU CS Academy environment shows red "Test Failed" for 6.3.5, use these debugging tricks: