Hello World!

Connect the Dots 2

In Chapter 16 of Hello World, we presented a Connect the Dots program that would create a “mystery picture”. (This is Listing 16.10.)

One of our readers created another version that draws the dots and lines one at a time, instead of all at once. So it’s kind of an “animated” version of the Connect the Dots program.

Once again, we want you to type this one in, not just cut-and-paste it from the download site. Here’s the code for the animated version:

This code might look a little fuzzy, and some of the lines are cut off. That’s because it’s an image of the code, and that’s the way Blogger displays the image. If you click on the code, you’ll get a much more clear version with nothing cut off. But it’s still an image, so you can’t copy-and-paste the code.

As we mentioned in the book, the list of dot coordinates is available from the download site, so you don’t have to type in all those numbers. (Just copy-and paste them from your browser to the code editor.) But you do have to type in the rest of the program if you want to see the picture.