CMU 15-112: Fundamentals of Programming and Computer Science
Extra Practice for Week 4 (Due never)
We do not have specific practice problems for this week. Instead, we encourage you to write short animations that use the mouse, keyboard, and timer. Here are some ideas to get you started:
- Write an app where a dot is centered in the screen, and it keeps growing larger until it fills the canvas, then it keeps growing smaller until it is its original size, then it stops changing.
- Write an app with a red dot and a green dot. The red dot moves in some interesting way, say sweeping across the canvas left-to-right or top-to-bottom. The green dot moves in response to the arrow keys. The goal is to make the dots touch, at which point 'You Win!' is drawn.
- Write an app where the user presses the mouse 3 times to enter 3 points, then the triangle formed by connecting those 3 points is drawn, then you display the length (to the nearest integer) of each side, and then using threeLinesArea from week1 you display the area of the triangle.
- You get the idea. Short apps that use some combination of mouse, keyboard, and timer. Invent your own. Have fun!!!!