Make your own free website on Tripod.com

All About Logo

Written for use with Macintosh LogoWriter 2.0
Adaptable to other Logo implementations
David P. Kressen Polytechnic School, Emeritus Pasadena, California
All About Logo
Written for use with Macintosh LogoWriter 2.0 adaptable to other Logo implementations
This final version (September, 1997) is copyrighted by the author as educational shareware. Reproduction and distribution for commercial purposes is prohibited. Reproduction and distribution for noncommercial educational purposes is encour-aged, under the following provisions.

You may obtain a copy of the book in one of four ways: by downloading a file from the Web Page http://www.polytechnic.org/kressen/logo.html by mailing the author a DD or HD 3-1/2" disk enclosed in a stamped, addressed return mailer for a Macintosh Word 5.1 disk version by requesting a spiral-bound hard copy version from the author (enclose $5 to cover duplication and mailing costs.) by requesting a copy from a colleague who has already obtained one. You may keep your copy for occasional reference or duplicate it to share with colleagues without obligation to the author, except to include this notice of share-ware policy in any copies you make. If you plan to use your copy for frequent personal or instructional reference, or if you would like a disk containing the program listings, please remit a $10 shareware development fee to the author. If you wish additional copies of the text for classroom use, you may either duplicate them yourself and remit $5 per copy shareware development fee or you may request them from the author at $10 each, postpaid, which includes the development fee. Please send a check or money order with your request. ` David P. Kressen (818)792-8546 3081 Oneida Street Pasadena, CA 91107 dkressen@earthlink.net

Table of Contents

Introduction .................................................................................................. 1
Macintosh LogoWriter Scrapbook ................................................................ 3
Unit #1 - Program Elements and Procedures ................................................. 5
Unit #2 - Expressions .................................................................................. 11
Unit #3 - Defined Procedures and Local Variables ....................................... 15
Unit #4 - Programs and Global Variables ..................................................... 21
Unit #5 - Program Design ............................................................................ 27
Unit #6 - Shapes and Labels ........................................................................ 33
Unit #7 - Animation ..................................................................................... 37
Unit #8 - Iterative and Conditional Control Structures .................................. 43
Unit #9 - Branch Control Structures ............................................................ 51
Unit #10 - Recursive Control Structures ...................................................... 57
Unit #11 - Sound and Music ....................................................................... 61
Unit #12 - List Processing ........................................................................... 67
Unit #13 - Advanced Animation .................................................................. 77
Unit #14 - Advanced List Processing .......................................................... 87
Appendix A - How To Deal With Common Error Messages ....................... 99
Appendix B - A Problem Solving Approach To Teaching About Logo ...... 103
Appendix C - Vocabulary For Logo Programming .................................... 107
Appendix D - Elements of Logo Programming Style .................................. 109
Appendix E - Concept Map and Lexicon of Terms ................................... 111
Appendix F - Selected Bibliography ......................................................... 117
Index - ................................................................................................ .... 121

Introduction

I have been learning and teaching Logo off and on for twenty-five years - since the first Terrapin Logo version became available for the Apple II computers in my classroom. Why? Partly because I have found it fun both for me and my students, who have ranged in age from five to fifty. Partly because I believe that the experience of programming is a valuable discipline in its own right.

Before Logo, I taught BASIC, and even wrote a book on the subject - Teach Your Computer To Think In BASIC. But mostly, I like to use Logo because, as its principal creator Seymour Papert puts it, learning to program enables me and my students to actually write for the computer.

As programmers, we are no longer constrained merely to accept the results of what others have written. Don't get me wrong. Lots of good programs have been written for us by others. Some programs, like word processors and geometrical explorers and drawing toolkits and data bases, give us a great deal of control over our computers and allow us to do things we could never accomplish otherwise.

But however much we feel in control of these programs, it's not the same feeling of control as if we had actually written the programs ourselves. By learning to write programs in an open-ended procedural programming language like Logo, you are truly in control of what appears on your computer screen and what goes on in the computer's unseen workspace. If you don't like something about what the computer displays or how the computer solves a problem, you can change it. If the creators of Logo left out a procedure you need, you can write one of your own. And in the process of learning how to write procedures for the computer, you learn something about "programming yourself" to become a better problem solver.

I firmly believe that every child should be exposed to Logo, preferably in primary or lower elementary school, with plenty of opportunities for informal exploration independently and in groups, with a sympathetic and knowledgeable guide in the background to provide start up challenges and assistance as needed. I also believe that children who are interested in moving beyond these early informal explorations deserve an opportunity in upper elementary and secondary school to truly master Logo and to experience the satisfaction of writing for the computer in a style that produces remarkable effects and that satisfies both the author and his or her audience of peers and adults.

There are many resources available to help primary and lower elementary teachers gain the knowledge and confidence to serve as "guides" for their children's informal explorations. The first three Units of this book provide such a background, as do many of the resources cited in the bibliography. However, there are not as many resources available to those who wish to move beyond early explorations into real mastery of Logo. This book is directed specifically to this audience: to teachers and parents who want to become fully literate in Logo for their own enjoyment and in order to assist young people to learn the language, and to secondary students who have the interest and ambition to pursue Logo literacy on their own.

This book is organized into fourteen sequential Units, each of which opens with a discussion of one or more new Logo concepts and closes with suggestions for exploring these in depth at the keyboard. As you go along, I urge that you stop reading whenever you come to a procedure, enter it into your computer, and analyze its effect. The text is designed to be used in conjunction with a Macintosh running LogoWriter 2.0, but the concepts apply to all versions of Logo and the explorations can be adapted to all implementations of the Logo language.

In Appendix B, I suggest an outline for using this material in a classroom or computer lab setting and summarize the strategies that I have found helpful in teaching this material to middle school students at Polytechnic School and to pre-service teachers at Pacific Oaks College. I hope that these comments will be useful both to those who use this book in a school setting and those who use this book in a pre-service or in-service course for teachers.

No matter what the educational setting, I think it is important for students and teachers to approach their work from the point of view that programming is a form of writing: Programmers and authors both work within the confines of their language. The "grammar" of Logo is extremely simple compared to the grammar of English, but it must be adhered to rigorously. Programmers and authors create their products for particular audiences. Two audiences are addressed simultaneously by the programmer: the Logo Interpreter that "reads" the program on behalf of the computer, and human colleagues who read the program for their own edification. The program must be intelligible to both audiences.

Programmers and authors choose from among all the words at their disposal those that will convey their meaning most effectively. Logo programmers have a big advantage here: they may create new words if their initial vocabulary is not rich enough to express their ideas clearly. Programmers and authors expect to revise their initial drafts in order to achieve the effects they desire. Programmers receive feedback from the Logo turtle in the form of lines drawn on the screen and from the Logo Interpreter in the form of error messages pointing out "bugs" in the original draft. Both programmers and authors receive feedback from their human audiences in the form of comments concerning clarity and effectiveness. In addition, programmers may choose to move a step beyond writing programs that are intelligible to the Interpreter and understandable by others; they may strive for "elegance" in their writing by designing programs that accomplish their purposes as simply and concisely as possible.

Please read the copyright explanation on the Title Page and include that page in any copies you make for distribution to your colleagues. I value your comments and your suggestions, sent to one of the addresses on the Title Page. David P. Kressen, September, 1997

The Macintosh LogoWriter Scrapbook

Logo is a programming language written by a team of computer scientists headed by Seymour Papert at MIT in the late 1970's. It is the first and only programming language written specifically with children in mind. Dr. Papert's goal was to provide children with a powerful "tool to think with," a tool that could be accessed easily by very young children but that was sophisticated enough to challenge learners of all ages. As more powerful microcomputers became available in schools, more powerful versions of Logo were developed to take advantage of their greater memory and more refined graphics capabilities.

LogoWriter, developed in the latter half of the 1980's, is a particularly user-friendly version of Logo. This book, written for use with Macintosh LogoWriter 2.0 (the last version offered) is finally complete after going through five field-tested revisions. LogoWriter uses the metaphor of a scrapbook containing pages of pictures (graphics) or writing (text). The scrapbook initially contains only three pages: the Contents page which is displayed when you boot LogoWriter, the Colors page which displays the 256 color choices, and the Help page which provides a few useful tips which you may modify for your own purposes. You add new pages to the scrapbook by selecting the "New Page" option from the contents page (click on New Page with your mouse or press  < RETURN > ). There is virtually no limit to the number of new pages you may add to your scrapbook.

The scrapbook page is the top portion of your computer screen. It contains a text cursor in the upper left corner and a graphics cursor (in the shape of a Logo turtle) in the center. The text cursor is used when your are writing and the turtle is used when you are drawing. The phrase "turtle geometry" refers to creating geometric shapes by drawing consecutive sides (from the turtle's point of view) rather than by connecting points on a geometric grid.

The bottom five lines of the computer screen, below the heavy line, are called the command center. The command center is not part of the scrapbook page displayed above it. The command center is where you type the instructions that affect your scrapbook and move the turtle on the page above. The command center is also used to display error messages from the Interpreter.

Besides providing scrapbook pages and the command center, LogoWriter reserves a section of the computer's memory called the workspace, used by the Interpreter to implement the instructions that you write in the command center. The Interpreter is a program that translates your instructions from the Logo-Writer language into a simpler machine language to which the computer can respond. If the Interpreter finds an instruction that it cannot translate (called a "bug" in computer jargon) it prints an error message in the command center, explaining its problem. It is then up to you to revise the faulty instruction.

As you see, there is also a text cursor in the command center. Unlike the text cursor at the top of the scrapbook page, this cursor is blinking which means it is "active", waiting for you to type commands. Although you can view only five lines at a time, the command center will actually hold hundreds of lines of commands; you may scroll through lines of text in the command center by using the up or down arrow keys or by clicking the mouse on the up or down arrow symbols at the right.

Each LogoWriter page contains three "buttons" which you may activate by pointing and clicking the mouse. The square in the upper left corner is used to close the page when you are done with it. The triangle in the upper right corner (with the F in it) is used to "flip" to the other side of the page. The circle in the upper right corner of the command center (with the S in it) is used to stop a run-away program. The Menu Bar at the top of the screen has many features that are already familiar to Macintosh users.

When the Contents page is displayed, the only feature available is to pull down the File menu to Quit the program, but when other pages are displayed the Edit, Search, and Font menus enable you to perform the usual text processing activities. The File menu also is expanded to include many features in addition to Quit. New Page saves the page you are working on and turns to a new page. Get Page saves the page you are working on and turns to the Contents page, from which you may select a different page. Name Page allows you to name a new page. The question marks at the top of a new page mean that it does not yet have a name. Save Page saves what you have done so far and then returns to the same page. Close is the same as clicking on the "close page" button described above. Print Screen sends and text and graphics displayed on the monitor to a printer; Print Text sends text from the current page to a printer. Quit leaves the program after giving you the option of saving or not saving the page you are working on.

There are two kinds of help available by pulling down the Apple Menu at the left end of the Menu Bar. The first provides you with short definitions of all the primitive procedures in LogoWriter and the second displays the page of your scrapbook named "Help." Pressing the  <ESCAPE> key returns you to the page on which you were working. (Incidentally, pressing  <ESCAPE> while working on your scrapbook page is a third way to close and save the page; it has the same effect as clicking on the "close page" box or selecting Close from the File Menu.)

The turtle's starting location on the page is called her "home position." If you wish to move her to a new starting place, you may drag her with the mouse.