N V Fitton, Assistant Professor in Mathematics
  and Computer Science
Northern Virginia Community College

Alexandria campus

 
 

e-mail:  vfitton@nvcc.edu
telephone: 703/845-6516
fax: 703/845-6006
office: 352 Bisdorf

NVCC home page
NVCC phone books etc.
 
Alexandria campus math department
NVCC computer science home page
Alexandria campus sciences division
 
 
 
return to Fitton's home page
 
Computer Science Advising Guide, written to help students choose CSC courses
 
   Here is my introduction to Logo. It is 20 pages long.
 
Programming in Logo
Logo is a wonderful programming language that anyone can download and use for free. It's easy to learn, it allows us to draw wonderful pictures, and it has enough depth for serious programming.
 
Download this. We use a version of Logo called MSWLogo, written for machines running Microsoft Windows 95 or later. This Logo was created by George Mills, building on the work of Brian Harvey and others. If it is already on your machine when you do this installation, you may get some confusing messages about deleting files. Accept the deletion, then do the installation again.
Here's an earlier version of MSWLogo that fits on a floppy. Hooray! It doesn't have the convenient Edall (edit all) button, which shows all of your procedures at once, but you can write edall on the command line for the same effect.
 
Here is my favorite Logo art site. Check out the links for different kinds of pictures at the bottom of the page, and observe that the site includes code for everything. And here are some tutorials written by teachers in Australia and Canada: Use my Logo code
You may study and use these code bits if you like. Instructions follow this list.
 
Very simple procedures: These use some color, random numbers (like throwing dice), and xy coordinates. A more complex and colorful design: How to use this code
Here's a flowchart for the method that follows, which isn't the only way to do it, just the one that's easiest for me:
  • open MSW-Logo in another window
  • click on one of my code pages
  • press Control-A for Select All
  • press Control-C to Copy code to clipboard
  • click in the MSW-Logo
  • click Edall to open Logo's editor window
If the editor window shows just two words, "to" and "end" (on separate lines), erase them.
  • click at the very top or very end of the text in the editor window
  • press Control-V for Paste
If there are duplicate names for procedures, you will have to erase or rename old procedures for the new code you just pasted to work.
  • in the editor window, do File menu/ Save and Exit
Enter the name of a newly pasted procedure along with any inputs that it requires on the Commander window's command line.
 
Using the code in the Art Gallery above may require more work. Study the code, try cutting and pasting parts of it that look relevant to what you want to do; if you would like more help with it after doing those things, come to see me.
 
Saving your work
There are two elements to your work: the pictures you draw, which to Logo are bitmaps; and the code you write to create the pictures.
 
Saving the picture
You can save all or part of the Logo screen as a bitmap and then include the bitmap in another file, such as a word-processing document or a web page. (Bitmap is a method of representing pictures in memory; .bmp is the last name that Microsoft gives to bitmap files, used in the same way as .gif, .mp3, and so on.) It would be nice if you could cut and paste Logo bitmaps with the mouse, but as far as I know, that capability is not built into the program.
 
Here's a PDF flowchart you can print from your browser with complete instructions. For the flowchart-impaired, here are the same instructions in words:
 
To save a bitmap, do this:
  • Bitmap menu
  • Save As
Choose an appropriate directory and a filename that you can remember. I always save things on the Windows desktop so I can find them, then move them to other folders after I've decided what to do with them.
 
I advise you next to check out the picture on your desktop to ensure that it's what you want. Logo's default is to take a 1000 x 1000 pixel area in the center of the screen. If that doesn't suit you, you may need to enlarge the area using Bitmap menu/ Active Area. If you need to cut it back, I suggest using Windows' built-in Paint accessory (Start menu/ Program Files/ Accessories). For general file viewing and conversion, nothing beats IrfanView.
 
Saving the program
Take my flowchart, please.
 
To save the code that creates your work, you should first put it in one or more Logo procedures and test them. You can create procedures either directly in the editor window or by cutting and pasting between the command history and the editor using the mouse to select, Control-C to copy, Control-V to paste. Once you have your procedures all in order, File menu/ Save will save all of your code to a file with the last name .LGO.
 
You can attach the .LGO file to an e-mail and send it to yourself; you can also cut and paste your code directly into the text of an e-mail, but depending on the mailer, you might lose line breaks.
 
It doesn't work!
I will help you. Here are the first questions I will ask:
  • Did it ever work? Did your download of Logo go OK?
  • Is the pen up? Enter PD (pendown) to make sure.
  • Are the colors for pen, flood, and screen different? Check the Set menu.
  • How's the zoom? Could you be looking at the wrong part of the screen?
Try the Reset button (or CS on the command line) and Zoom menu/ Normal, then try your procedure again.
 
Expectations for Math 151 students
The handout that we used for the class meeting in the computer laboratory is based on several fundamental concepts that occur in virtually all programming environments:
  • sequence
  • repetition
  • subprograms
  • variables
  • decision-making
The work that you submit (by e-mail before Thursday, December 11 at 6 pm) should show that you understand and can use two or more of these ideas to make a novel and interesting geometric design. The procedure whee, a.k.a. 3whee, on the
flowers and colors link is an example of the desired complexity. Many students will surpass it.
 
You must write a Logo procedure whose name can be entered on the Logo command line (with or without variable values) to produce your design on the screen. Your procedure should call one or more other procedures. You are free to use the work of other programmers for inspiration and hints, but the work you submit must be your own, or your own team's, if you are working with other students. If your design relies on certain colors, then they should be set within the Logo procedure.
 
Send your work as a file with .LGO extension (Logo's default) attached to an e-mail. In the e-mail, tell me what procedure name and variable values, if any, to enter on the Logo command line.
 
You may certainly submit more than one procedure!