Com S 100J Introduction to Computer Programming Grade: letter or S/U Spring 2005
655-085 TR 09:05 Kimball B11 Instructor: David Gries 4 credits
655-276 TR 11:15 Olin 255 Newsgroup: cornell.class.cs100j

Interesting A4 things
About email
Academic Excellence Workshop
Academic integrity
Exams & grades
Handouts, general
Staff info
Times & places
Email Gries


This page gives links to interesting procedures that were written for assignment A4. Each one is either in class Ball or in class MyTurtle. When you download one (or more), also download and use this version of Below, the names of the classes have been extended with the Cornell netid(s) of the student(s) submitting the assignment. The comment at the beginning of the class says how to run the interesting thing. We make no comments about the Java programming in these cases.

The first 8 or so are the most interesting. Watch yourself go through a tunnel, with the hole at the end getting bigger and bigger as you draw nearer to it. Also, watch the program draw ALL spirals --it is fascinating. See a model of the Bohr atom, with electrons orbiting around the nucleus! Watch the image of Fighter from Final Fantasy walking across the screen. Watch two balls bounce in a cube! Watch a simulation of gravity when a ball bounces. The beginnings of the breakout game --rectangles disappear when the ball hits them, and there is a bar going back and forth that sends the ball away from the rectangles (and changes the ball's color) when the ball hits it. When two balls collide, one of them splits into two balls (of a different color). Pretty soon, there are lots of balls. Give it any number of balls in an array and they all bounce around.

Ballml363. Create 4 rectangles at the top and one ball. The ball bounces around. When it hits a rectangle, the rectangle disappears. Create a bunch of rectangles at the top and one ball. The ball bounces around. When it hits a rectangle, the rectangle becomes black. Watch a hockey "ball" bounce around. When it hits the net, a red light blinks. Two balls are created and started bouncing around. When one hits the boundary or the other ball, it changes color. The balls are not erased, so you see their paths. Two balls start bouncing around. When they collide, they split into smaller balls. As the ball bounces around, flames trail behind it.

Ballnbc5saf37. n balls (second argument are moved at random speed between s/2 and -2/3 (s is first argument). They change color randomly at each step.