DogAndPanda: turtlesuorcebook.htm

turtlesuorcebook.htm

'
r          A PRACTICAL GUIDE TO LEARNING~AND TEACHING LOGO ~)
ILLUSTRATIONS BY C. MICHA
S
2A?s'
-
-
-
A PRACTICAL GUJDE TO LI. J.N'NG AND TEACHING l-QGO
DONNA BEARDED KATHLEEN MARTIN JIM MULLER
Join the Young People s '.o,; Association's turtle and rabbit, (distant cousins of the famous tortoise and ./are) in this easy-to-read, comprehensive and fun book as they explore the fundamentals of programming and using Logo. Authors Bearden, Martin and Muller, all from YPLA/have •compiled step-by-step explanations, activities, and work­sheets for you and your students that illustrate the concepts of turtle graphics in Logo. Some of the worksheets and activities have been developed for group use away from the computer. All of them have bgenlcLassrpopri tested and alhSf theYn work\
TABLE OF CONTENTS
Ideas on Turtles, Rabbits,,Children and Learning • Technological Turtle Tools ® The Structure of Programming • Digging Into Logo • Turtle Commands • Defining Pro­cedures • Variables w~ Curves and Circles • Recursion • Conditionals ® Tesselations • Designing With Color • Turtle Positions • Fun With Words ® Editing Features • A Logo Reference and Resource Guide • Logo Procedures • Logo for Pre-Schoolers # Logo Cross-Reference Guide
The perfect companion ... 1, 2, 3, My Computer and Me by Donna Bearden. This Logo Funbook for kids is a workbook incorporating many of the activities from the Turtle's Sourcebook. Written for children and filled with light-hearted illustrations, 1, 2, 3, My Computer and Me is a perfect first book of Logo for children of all ages.
RESTON PUBLISHING COMPANY, INC.
A Prentice-Hall Company Reston, Virginia
0-8359-7890-7
r
r
r r
r
r
r
r
r
r r
I. r
r r
The Turtle's Sourcebook
r \:
:?3?
ISBN 0-8359-7890-7
©1983
by Reston Publishing Company, Inc. A Prentice-Hall Company Reston, Virginia 22090
All rights reserved. No part of this book may be reproduced in any way, or by any means, without per­mission in writing from the publisher. 10 987654321
CONTENTS
The Turtle's Sourcebook..................................................................IX
The Turtle's Sourcebook....................................................................1
Ideas About Turtles, Rabbits, Children, and Learning.
The Tortoise and the Hare.................................................................3
Chapter 1
Technological Turtle Tools.................................................................9
The Structure of Programming........................................................17
Digging Into Logo............................................................................23
Chapter 2
Turtle Commands.............................................................................27
Chapter 3
Defining Procedures.........................................................................69
Chapter 4
Variables..........................................................................................87
Chapter 5
Curves and Circles.........................................................................101
Chapter 6
Recursion........................................................................................117
Chapter 7
Conditionals....................................................................................129
Chapter 8
Tesselations....................................................................................141
Chapter 9
Designing With Color.....................................................................151
Chapter 10
Turtle Positions..............................................................................165
Chapter 11
Fun With Words.............................................................................181
VII
Appendix A
Editing Features
199
Appendix B
A Logo Reference and Resource Guide.........................................203
Appendix C
Logo Procedures
Graphics Dumps Procedures
The Towers of Hanoi.....................................................................209
Appendix D
Logo for Preschoolers....................................................................217
Appendix E
Logo Cross Reference Guide..........................................................225
VIII
I 1
r
The Turtle's Sourcebook. ••
was developed using the versions of Logo available for the Apple II and TI home computers. Since then, other versions of Logo have been made available and new versions will be coming out in the near future. In addition, there are an increasing number of programs which pro­vide Turtle Graphics features but without the list processing capabilities of Logo.
Some of these new versions of the language offer new enhancements and other features which exemplify the evolution of Logo.
The preliminary version of Logo for the Atari computers is very much like Apple Logo. Logo Computer Systems Inc. developed both versions. Users should be able to follow the Apple Logo commands in the Sourcebook with no problem. Only Atari Logo offers con­siderably more capabilities than explored in this book. It includes 127 colors, up to four Turtles on the screen at once. Each Turtle can draw with three pens. The Turtle will play music. It will move at an assigned speed. It is shaped like a Turtle to accurately define its attitude and direction. In addition, the language will come in a plug-in cartridge which af­fords the user considerably more free memory than existing versions.
Commodore Logo, developed by Terrapin, Inc., is very similiar to MIT Logo, only it of­fers more colors and color capabilities. Users should be able to use the MIT Logo listings in this book with no problem. You will need to refer to your Reference Guide for more in­formation on color and graphics.
Color Logo for the Radio Shack Color Computer is a Turtle Graphics implementation which can be used with this book. Color Logo is limited to integer math and does not in­clude list processing commands. There are, however, a number of additional operations which can be performed using Color Logo which are deserving of mention here.
Most importantly, Color Logo offers the opportunity to develop additional Turtles through the HATCH command. As in MIT Logo, the shape of the Turtle can be changed. Only in the case of Color Logo, the shape of each of up to 255 Turtles can be changed offering one of the most comprehensive opportunities for on-screen animation.
Color Logo also offers a DOODLE mode that is particularly useful by primary grade and preschool children.
CyberLOGO is another Turtle Graphics implementation for the Apple II and requires only 48K of memory. Many of its procedures can be done using the Turtle Graphics com­mands listed in the Sourcebook. Like Color Logo and TI Logo, CyberLOGO is limited to integer mathematics. Also like Color Logo, it includes a SKETCH mode which is particularly useful by primary and preschool children.
One of the most helpful features of CyberLOGO is the HELP command which provides comprehensive on-screen instructions. Referring to the HELP screen does not alter the pro­cedures in process.
By the time this book gets into circulation, Mattel Logo, DR Logo for the IBM PC and CP/M systems will be also available. In addition, Logo will be available for the Spectra Vi­sion computer and for others we haven't thought of yet. We welcome them all. We hope you will also. The proliferation can only serve to make Logo more valuable. Learning about the different versions can only serve to make you a more understanding user and teacher.
i
i i
r
r r r r
r r r
IX
Turtle Graphics Cross Reference
A cross reference of the various Logo implementations is provided in the appendix. This listing is designed to help you with this book. It is not meant to be a complete listing of any of the versions. Refer to your language reference guide for more information on your particular version.
"Pobody's Nerfect!"
Yes, we make all sorts of mistakes. If you find errors in any of the listings in this book, or if you have any problems, please let us know so we can correct these. Any corrections will be published in our monthly newspapers, Turtle News and Logo Newsletter.
tj^ti^Me^
^~£;
Young Peoples' LOGO Association
P.O. Box 855067
RichardsonJX 75085
X
THE TURTLE'S SOURCEBOOK
IDEAS ABOUT TURTLES, RABBITS, CHILDREN, AND LEARNING
On and Off the Computer
r
Hi! Allow me to introduce myself.
I'm Logy, the Logo Turtle. You'll be seeing me throughout this book, pointing out some of the special activities and fun-things you and your children can do both on the computer and off. For the parents and teachers who may well be looking upon the computer age as more revolting than revolutionary, my friends and I have put together The Turtle's Sourcebook. We've been there.
We can appreciate the stark reality of one teacher, one computer, 25 students, and a 45-minute class period. How can you make the most of the computer as a learning tool under these circumstances? We feel for the parents who feel out of touch with the age in which their children are developing.
This book is for you.
The Turtle's Sourcebook is a full of practical, down-to-earth ideas on how to make the most of the time you and your children spend with Logo and the computer. It is not a comprehensive reference guide to Logo or the computer. But we would like to think it's a guide to more effective thinking. We start with the fundamentals of Turtle Graphics. With the help of a wide range of off- and on-computer activities, plus an assortment of worksheets and "cue cards" for the children, we look to provide all of you with a sound introduction to the learning — and thinking — fun to be found in Logo and Turtle Graphics.
r
r r
For the children, who want their own workbook, we have written, 1, 2, 3, My Com­puter and Me. That is an illustrated Logo funbook for elementary school-aged children. Both of these books offer the same practical, structured approach to exploring the learn­ing opportunities of Logo and Turtle Geometry. Along the way, you'll discover some pret­ty exciting ideas.
This is what this Sourcebook is really all about — discovering new ideas. And because this is an ever-changing process, we hope you'll participate in this process by sharing your ideas and experiences. As we test new concepts and activities, we will report on these through our own monthly publications.
You can help with this exchange.
Once you have worked — or played — through these exercises, we'd like your comments. If you are working with a group of youngsters and come up with activities or examples that are particularly helpful, we would love to hear about them. One thing we have learned about children and computers — they love to share ideas with their friends.
We're no different! Please keep in touch.
Young Peoples' LOGO Association
P.O. Box 855067
Richardson, TX 75085
2
THE TORTOISE AND THE HARE...
A COMPUTERIZED UPDATE OF THE AGELESS FABLE.
Once upon a time there was a tortoise who moved very slowly but steadily along. He enjoyed his slow, easy life, learning from every new tree and every new experience. And once upon that same time there was a hare who leaped and hopped all about. Now the hare was always teasing the tortoise for his slow steady pace but the tortoise never retorted. He just kept minding her own business, moving steadily forward step by step, learning more from each new sight and sound.
But one day, tortoise had just had it with the hare. He had teased him one too many times.
"Hare," he said, "I challenge you to a race. Whoever can make it to the other side of the forest and back first is the winner."
The hare laughed so hard he had to hold his sides and roll on the ground. He readily agreed and the race began.
3
The tortoise started off at a slow but steady pace — step, step, step, never faster, never slower. The hare leaped and hopped and did cartwheels around the tortoise, and then he sped off towards the other side of the forest.
As you have probably already guessed, or you already knew, because your Grandfather read the real version of this story to you when you were only three years old, the tortoise won the race and the hare was very em­barrassed and never teased the tortoise again.
And that's probably where your Grandfather's story ended.
Well, once upon a much later time, there was a turtle. He was a distant cousin of the grandchild of the now-famous tortoise. And, of course, there was a rabbit (a distant cousin of the grandchild of the now-infamous hare.)
Both the turtle and the rabbit were given the opportunity to learn about computers and Logo. They were both delighted and couldn't wait to see what they could do.
The turtle began to explore Logo and the computer, one step at a time. The rabbit glanced at the first chapter of the Sourcebook, which was such an easy chapter that he understood it at once. He bounced from one chapter to another, back and forth, and then he glanced over at the turtle who was still on Chapter 1.
1
"Hey, that's easy stuff," he said. "Look at this!"
The turtle was impressed with what the rabbit could do, but he was having a lot of fun on his own. He seemed to know that if he kept working along steadily, he would even­tually be able to do the marvelous things the rabbit copied from the Sourcebook.
i
r r r
r r r r r r r r r r r r r r
Days passed and the rabbit was still bouncing from one thing to another. By now the turtle was up to Chapter 2.
One day, the rabbit glanced over the turtle's shoulder. He was just about to say, "Are you still on the easy stuff?" But when he saw the screen, he looked puzzled and said, "Hey! How'd you do that?"
The turtle explained slowly, step by step, what he had done to make the wonderful pro­cedure on the screen. But the rabbit didn't understand. That wonderful procedure was nowhere in the book. He knew, because by now, he had tried every example in every chapter.
"But, Rabbit," explained the turtle, "my procedure's not in the book. I made it up."
"But how did you do that?" questioned the rabbit. "How did you know what to do?"
"Gee, I thought you knew, Rabbit," said the turtle as he turned the page to Chapter 3. "Logo is the most fun when you start with what you know and then learn to use your imagination to create new things. It helps you understand what you're doing if you'll get away from the computer for awhile and see how these ideas relate to our everyday world. Sometimes it is fun to make up a game using Logo and Turtle Graphics commands.
"Did you ever think of playing Logo baseball? What about Logo football?" asked the turtle. "How are you ever going to learn if you don't use your imagination?"
The rabbit was getting embarrassed and so he just kept quiet.
"Logo is a language which allows you to explore all of the wonderful things a computer can do. What's really fun is that you can do just about all of the activities off the computer as well as at the console. And you couldn't possibly fit all of that into just one book," said the turtle.
"Logo isn't like BASIC, just a small number of commands that you must use within the same program," said the turtle. "Logo is a language of imagination. If you want the com­puter to do something, all you have to do is teach it how — really!"
"If Logo is so great, why are there so many BASIC programs around?" asked the rabbit.
"There are lots of mosquitos, ticks and annoying carrot crunchers around also, but that doesn't mean I have to like them more than a nice, cool piece of crisp lettuce," said the turtle.
"Let's face it, Rabbit! BASIC was old hat when your father was your age. Now we don't have to use a limited symbolic instruction code," said the Turtle.
"When you think about it, BASIC isn't a language as everyone thinks about languages. It is a symbolic code — just as the definition says," Turtle added. "Can you imagine what would happen if I told someone to GOSUB? I'd either have a sore jaw or they'd ship me off to the funny farm."
"BASIC is now 21 years old. And I really have no complaint with it — I respect age. And, yeah, it is certainly good to know more than one language on more than one com­puter," Turtle went on to say. "But computers are far more powerful than they were back in 1962. If you look at a lot of the really good BASIC programs being done, you'll find that BASIC is used primarily as a means of getting to assembly language. But Logo can do that, too. Come on! Get your head together, get structured!"
"Now we can talk to the computer in our own everyday vocabulary. We can even design our own computer language to mean what we want it to mean. If we want to draw com­plicated pictures, all we have to do is start out with simple commands like FORWARD, BACK, LEFT and RIGHT. And any three year old understands that language. If we want to make word games or write other messages, all we have to do is teach the computer how," the turtle added.
"Why bother? I don't have to use a computer to draw those pictures. I can do it with crayons or pencils in a lot less time," the rabbit said.
"You have been pounding on that computer keyboard for days now. Haven't you learn­ed anything?" asked the turtle.
"Sure! I know all of the procedures in the book. Here, just ask me to list any one of them," answered the rabbit.
"You know, my mother told me all about how she used to sit in school reciting math tables and memorizing spelling words; how she learned everything by 'rote,'" said the tur­tle. "Well, look up that word in the dictionary. It will tell you that rote is 'the use of memory, usually with little intelligence.' You may have memorized all of those procedures, but I wouldn't dare say anything about the intelligence involved."
"Yeah, but I can still draw faster with crayons," the rabbit retorted.
"C'mon, now. Use that thing between those oversized ears," added the turtle. "If all I wanted to do was draw, I'd use a graphics program. Logo is a lot more than that. Most importantly, it teaches you how to think. Drawing on the screen helps you visualize a prob­lem, break it down into its component parts, analyze those parts, and then learn how to structure a solution one step at a time. The color, drawing and other activities and Logo games you can play off the computer just help make it fun and more understandable. But you soon see that you can solve all sorts of other problems the same way, one step at a time.
"Now why don't you go back to page 1 and start over," scolded the turtle."Give your imagination a chance — not an excuse. Get up! Walk around! Feel what you're doing on the screen. Who knows? You might even learn something!"
This really got to the rabbit. He'd had enough harassment for one day and he wasn't about to be outdone again.
And so he sat down with the Sourcebook and began to read. Soon he saw that he could design his own complex geometric figures and write some neat text programs. Mistakes
r r r r r r r r r r r r r r
r
r
r
r
weren't embarrassing anymore. He didn't even mind walking through the off-computer ex­ercises. In fact, they were really where the fun began. It was almost as much fun making up activities as it was making up procedures and debugging them.
And, yes! The rabbit was soon visualizing all sorts of things, and assembling his thoughts in a procedural, though very creative manner. And when he finally got his procedure to run correctly, he did a couple of cartwheels. He puffed out his chest in pride, straightened his ears, and then called the turtle over to see.
"Hey, that's the idea," said the turtle. "You know, Logo makes learning a lot of fun. It is a language all its own that makes solving problems easy."
"Yeah, you know I used to think that arithmetic and mathematics were just a bunch of tables and formulas that were a pain to memorize," said the rabbit. "But this begins to make a lot of sense. Just like English and French are languages humans speak, math is a problem-solving language computers speak. And it's not just for computers. I've been thinking about it and can see how a lot of things fit together. I'll bet these analytical skills we have developed at the computer can help us do all sorts of other things."
"Surprise! Surprise!" said the turtle.
"But, Turtle, how did you know all of that so fast?" added the rabbit.
"Rabbit," answered the turtle. "I have to be honest with you. See that small triangle on the screen? That's really my cybernetic cousin, Ernestine. She's the Logo turtle who really makes all of these great Logo pictures possible.
"Let's just say it runs in the family."
Epilog:
Today's young people are growing up in the midst of an information and technological explosion. Some are rabbits, hopping around, picking up all of the information and ex­perience they can — and then wondering how to use it all. Others are turtles, exploring each new phase of their rapidly changing environment, observing each step from different perspectives, discovering new ways to synthesize each new experience into their lives.
Today's parents and teachers must also face this information and technological explo­sion. And this can be far more perplexing for adults than it is for young people.
To some adults, this microelectronic revolution is the bright new hope for the future. They view it as the chance for young people to break out of the mechanical structures of the past and explore the power of the imagination. It is the opportunity for them to use their minds more effectively and efficiently.
To others, it is viewed as a threat to family unity, a sword to further divide the genera­tions, another disruption of parental and school authority.
To the Young Peoples' LOGO Association, it is an opportunity. Neither Logo nor the computer is a magical device which will automatically make the users more intelligent. They are merely advanced technological tools which need to be used effectively to enhance lear­ning. Of course, humans have been abusing technology since our prehistoric ancestors first found that the rock that split open a coconut could split open the enemy's head with equal ease. Most certainly, the computer offers opportunity for technological abuse.
Let's put the computer into proper perspective. It is nothing more or less than a tool to enhance learning. Logo is nothing more or less than a language to make this tool easier to use. Both need to be effectively integrated into the educational process. We may then be able to take better advantage of this golden technological opportunity.
If young people are given the opportunity to develop the analytical skills required to make intelligent choices, the chance to develop confidence in their decisions, and the understand­ing to make to the most of them, there may not be a whole lot to worry about.
8
CHAPTER 1 TECHNOLOGICAL TURTLE TOOLS
A question parents often put to educators is, "Don't computers diminish a child's ability or desire to learn the basics, such as adding, subtracting, multiplying and dividing? Aren't these merely crutches, a lazy way to solve problems?
First of all, mathematics is far more than just the simple working of formulas to get a correct answer. Mathematics is a language, a systematic approach to solving problems. Often students — and adults — get so bogged down with the basics that they "drop out" and never really learn what mathematics is all about.
Secondly, computers, calculators and other computerized learning devices can only com­pute. They cannot think. They cannot teach. While they can store information, they can­not learn in the true sense of the word. Indeed, if a child doesn't know the basics, these tools are virtually useless.
A calculator can not tell a child what to enter and in what sequence to solve a particular problem. A computer can not create ideas. It can not take bits of information, arbitrarily analyze each, select the best parts, and come up with a new idea. A computer can not be irrational. Flip the switch on a computer, and it just sits there doing nothing.
There may be times when you wish that humans had built-in switches. There may be other times when you wish your children had them.
And there may be other times when you think they do.
9
Just as pencils, hammers and slide projectors are tools, so is the computer. The com­puter is nothing more than a sophisticated audiovisual aid. Just as projectors are useless without slides or films, computers are useless without software. And just as there are films and slide shows of questionable quality, there are programs and computer languages of questionable quality and usefulness.
Children readily accept this. They have no preconceived notions or fears of technology. It is only the adults who find the computer to be intimidating, confusing and unworkable.
Think about it for a moment.
Do you blame the pencil for making an error in spelling? Do you throw out the fork, because it carried some food to your mouth you didn't particularly like?
As pencils and forks are tools of the other senses, the computer is a tool of the mind. It does the administrative work of the mind very well — the calculating and computing, the filing of information for later use, the sorting of data, and the recalling of particular segments.
The computer offers the potential of being an invaluable tool for children, an electronic key to unlock their creativity and imagination. Until recently, this "unlocking" process was
inhibited by computer languages no less foreign than Middle Eastern languages and alphabets. COBOL,         FORTRAN,
BASIC, INIT, GOSUB, SEG$, CHR$, ABS and RND are not part of our everyday vocabularly.
Into this scenario steps the Turtle.
Much has been written about user-friendly languages employing Turtle Graphics. Developed at MIT as a feature of the Logo computer language, Turtle Graphics introduces even the youngest children to the potential of the computer.
But just what is that potential?
The child takes a language disk or a program tape and loads it into the computer. Then something magical seems to happen. The TV or monitor screen lights up and marvelous things begin to appear on the screen. Just how does this happen?
When you turn on your television set to watch a program, you know there are people far away at the broadcasting station who are making the program happen. You know some­one is pointing a TV camera at the newscaster you see on the screen. Someone else you don't see sits in a control room flipping switches to make sure the program is transmitted from the broadcast antenna to your receiving antenna.
But what about a computer? Is a computer like a TV set? Are TV programs like com­puter programs? What is software? Why do some of the "things" computer manufacturers call software actually come in hard packages? What is a computer program? Why do I need one?
10
Computer software and hardware are different — obviously!
When you go to a hardware store, you buy "things" such as nails, screwdrivers, ham­mers, saws and other things you can pick up and feel. Computer hardware is no different. It includes the things you can see and feel — the console or keyboard, the monitor, the disk drives, the tape recorder and other hard accessories you use. Some of these things are called, peripherals because they are peripheral to the operation of the computer, on the outside, and used only on occasion.
Software is "soft/' Like the recipe printed in a cookbook, or a list of things to do to­day tacked on a bulletin board, computer software can be written and stored away.
Just as you can record music or other messages on cassette tapes, computer data can also be recorded on tape and then played back, or loaded, into the computer. While cassette tapes are inexpensive, they can stretch easily or be scratched if not re­wound. This will damage the program so that it cannot be loaded.
Floppy diskettes can be compared to phonograph records. Imagine a diskette as a cassette tape flattened out and molded into a circular disk. Where a phonograph can play any selection by putting the needle in the first groove of the selection, the disk drive moves a magnetic head back and forth over the disk to read the selected tracks of the disk. To protect the diskettes, they are packaged in a protective sleeve with a few slots cut into it so that the disk drive head can read it.
DO NOT TOUCH THE MAGNETIC PORTIONS OF A TAPE OR DISK! Fingerprints can contaminate programs very easily.
BACK IT UP!
BACK IT UP!
BACK IT UP!
While some software publishers do everything to stop you from copying their material, make a copy of everything you have and programs you write, especially those written by the children. In fact, if you can, store tape programs on diskettes, and diskette programs on tape. Then if you can not load programs because of a faulty disk drive or a malfunction­ing tape recorder, you'll always have a copy handy.
11
Another way to store software is to imprint it on tiny memory chips. These chips, or integrated circuits, can be built into the
computer, or they can be housed inside of a plastic cartridge for safekeeping. The cartridges can then be plugged into the com­puter. One advantage to this is the programs are there permanent­ly. They are very difficult to damage, and they load almost in­stantly. Of course, you cannot change the program to suite your own needs. You have to take what you get.
But how does all of this fit together?
To get a little bit better picture of all of this, let's take a look at a place with which we are all familiar, the kitchen. When it is time to create a meal, usually the first thing to hap­pen is that the chef enters the kitchen, turns on the lights and other appliances he intends to use for the meal. He then looks in the cookbook for the desired recipe. After reading the recipe, he may write down the ingredients he will need for that particular meal on a pad of paper or possibly on a chalkboard. The ingredients are gathered. The mixing and processing of the ingredients are properly controlled and timed according to the recipe. When completed, the meal is sent out of the kitchen to be served.
The chef in a computer is the CPU or Central Processing Unit. This is where the action takes place. It contains three basic elements, the clock or timer for all of the actions within the computer, the controller that reads the clock and controls the sequence of operations in accordance with the time and the recipe, and the Arithmetic and Logic Unit (ALU) that is the adding machine where all of the information is processed.
Read-Only Memory (ROM) circuits are like the recipe books in a kitchen. They can only be read. They cannot be changed. ROM circuits hold the recipes for the computer's color, graphics and sound. On some computers, they hold the recipes for the languages used.
Random Access Memory (RAM) is the electronic chalkboard of the computer. Informa­tion is stored there temporarily. It can be moved around and erased. Indeed, when you turn off the computer, the slate is wiped clean. The computer forgets all of the information you entered.
The I/O circuits are merely circuits to translate electrical signals from the outside world into signals the computer can understand.
There is one other important factor to consider, the bus structure. A good chef will usually lay out the kitchen so every step flows smoothly without complications or excessive travelling from pantry to workspace, for example. The bus structure of a computer does the same thing. Electrical channels are grouped so information can travel efficiently to and from dif­ferent parts of the computer. Some are designed to carry information one way; for exam­ple, from the central processing unit to the memory. Others carry information both ways.
Looking a the alledged simplified diagram of a computer system, you might well wonder how any sense could ever be made from anything like that. Another perfectly valid ques­tion is why anyone would want to make sense out of it?
The answer to that question is, "No, you don't really have to make sense out of it." Hopefully, when you complete this chapter, you'll know that you don't need to make any sense out of it. The goal is to provide you with enough of an overview so you can make that choice: Do you want to know what makes a computer tick? Or do you just want to leave it alone?
12
TO EXTERNAL< HARDWARE
ADDRESS BUS
ARITHMETIC
AND LOGIC UNIT
Sz
xz
READ­ONLY MEMORY (ROM)
RAMDOM-ACCESS MEMORY
(RAM)
DATA
n
CONTROL
sz
CENTRAL
PROCESSING
UNIT
DATA BUS
A simplified diagram of a computer system.
If that is simplified, I'd hate to think about what a complex system would involve.
On the other hand, let's see if we can't change the words around a bit so that they make a bit more sense. We used the analogy of the chef in the kitchen before. How would this diagram look changed around like that?
MIXER
xz
xz
n
RECIPE BOOK
CHALK BOARD
KITCHEN DOOR
TIMER
5Z
CHEF
13
Now let's compare the operation of these two systems.
Kitchen
Computer
1.    The chef turns on lights and the appliances to prepare meal.
2.    The chef gets down the cookbook.
1.    The Input circuitry signals
the CPU to get ready to run a program.
2.    The computer signals the Read-Only Memory program to get ready for action
TO
OVEN
ETC.
---------------------—_
lilsIMlilBll'l
MIXER
xz
\z
JLL
RECIPE BOOK
CHALK BOARD
KITCHEN DOOR
TIMER
5Z
CHEF
14
3. The chef reads the recipe from the 3. The CPU reads the program per-cookbook.                                                              manently stored in the ROM.
MIXER
^rK
RECIPE BOOK
CHALK BOARD
KITCHEN DOOR
TIMER
CHEF
OR
3. The chef transfers the recipe from the cookbook to his chalkboard.
3. The computer transfers the program from a cassette tape or a floppy diskette to its Random Access Memory.
15
4. The chef accumulates the ingredients to be mixed at his work area.
4. The Controller accumulates data from the program in memory or from the keyboard and holds this within a special "accumulator" register in the CPU. This is a special type of memory in the central pro­cessor to hold only those bits of informa­tion being used at that time, such as a series of numbers to be added.
5. The ingredients are mixed according to the recipe.
5. The data is processed in proper sequence.
6. The meal is served.
6. The data is sent to the Output circuits where it is translated into signals the printer, display, disk drive or other device will understand.
So you see, it really isn't all that mysterious.
We all tend to think about the computer as a horrendously complex and devious device. Indeed, parts of the system are beyond comprehension. But does this really concern the family or classroom user?
Do you need to know how the program gets from the studio to your television set? When you get behind the wheel of your car, do you need to know how the gasoline is being transfer­red from the fuel tank to the engine and then exploded to drive the wheels?
Of course not! But you should be selective about the TV shows you and your family watch. And you should be able to handle the car before you get behind the wheel.
All that takes is good programming.
16
The Structure off Programming
r
-
-
The structure of what?
What do you mean by programming? What is a program? How does it work? Why should a program be structured?
A computer program is a list of instructions that tells the computer the things it is sup­posed to do. It also tells the computer in what order to do them. The computer starts at the top of the list and does the first instruction, then the second, then the third, until all of the instructions have been completed.
Of course, if you are given a list of instructions, you can decide how you are going to do them. You may decide that you can do the job more efficiently if you change the se­quence. And as long as the job gets done, who's to care?
But a computer does not know how to decide anything by itself. So when you write in­structions for a computer, you have to be very careful to tell it everything it needs to know and in what sequence it is to do the jobs. What must be done first? What needs to be done second? You can leave no information out or the computer will become very confused.                                                                     . jf
Let's see how this concept works.
r
r r r r r r
With all of the talk of robots these days, let's pretend you have been given a marvelous gift to clean your house and do all sorts of other things around the house. First, you will have to program the robot's computer. We are going to assume the robot can understand plain English and that it can do everything we tell it to do.
The first thing we must do is program the robot's optical system to recognize the things in the house so that it will understand what things we are talking about in our program. It will also need to know where to go to carry out the instructions listed in the program you will write for it.
17
Now let's write a general clean-up program.
10       GO TO CLEANING CLOSET A
20       OPEN THE DOOR
30       PICK UP THE VACUUM CLEANER AND DUST CLOTH
40       GO TO ROOM #1
50       EMPTY THE ASHTRAYS AND WASTEBASKET INTO THE GARBAGE
CAN ON THE BACK PORCH
60       DUST ALL OF THE FURNITURE AND SHELVES
70       PLUG IN THE VACUUM CLEANER
80       VACUUM THE FLOOR
90       UNPLUG THE VACUUM CLEANER
100     GO TO ROOM #2
110     EMPTY THE ASHTRAYS AND WASTEBASKETS INTO THE GARBAGE
CAN ON THE BACK PORCH.
120     DUST ALL OF THE FURNITURE AND SHELVES
130     PLUG IN THE VACUUM CLEANER
140     VACUUM THE FLOOR
150     UNPLUG THE VACUUM CLEANER
160     GO TO ROOM #3
At first glance, this list appears to be correct for cleaning the first two rooms of the house. If the program was written to include Rooms #3 and #4, we could assume that the house would be cleaned.
But let's read this program as the robot would read it.
18
r
r r r r r r
r i
The robot first reads its map and goes to the closet. After opening the door, the robot picks up the vacuum and dust cloth and heads for Room #1.
50 EMPTY THE ASHTRAYS AND WASTEBASKET INTO THE GARBAGE CAN ON THE BACK PORCH
The robot checks the map and then proceeds to the back porch, carrying the vacuum cleaner, dust cloth, ashtrays, and wastebasket. First, it obediently empties the ashtrays and wastebasket. Again, following instructions to the letter, the robot dusts all the furniture and shelves, and then dutifully vacuums the floor.
Having completed its tasks on the back porch, our friendly robot proceeds to Room #2. Finding the ashtrays and wastebasket, it again proceeds to the back porch, empties the ashtrays and wastebasket into the garbage, and then proceeds to dust and vacuum again.
Congratulations! You now have the cleanest back porch in the neighborhood.
Seems sort of silly, doesn't it? But that is exactly what the computer was told to do. And since the robot is only a computer and can make no independent decisions, it just keeps on cleaning the back porch.
So — let's go back and restructure the program. We can write a long linear program, one where every instruction is listed in sequential order. Or we can analyze the tasks in­volved, break them down into all of the essential component elements, and then develop a structured, procedural approach to cleaning the house.
19
First, let's get the bugs out of the first program.
10       GO TO CLEANING CLOSET A
20       OPEN THE DOOR
30       PICK UP THE VACUUM CLEANER AND DUST CLOTH
40       GO TO ROOM #1
50       PLACE THE VACUUM CLEANER AND DUST CLOTH ON THE FLOOR
60       CHECK THE ASHTRAYS AND WASTEBASKET
70       IF EMPTY, GO TO 100
80       EMPTY ASHTRAYS AND WASTEBASKET INTO THE GARBAGE CAN ON
THE BACK PORCH
90       RETURN TO THE ROOM YOU CAME FROM
100     PICK UP THE DUST CLOTH
110     DUST THE FURNITURE AND SHELVES
120     PUT THE VACUUM CLEANER PLUG INTO THE ELECTRICAL OUTLET
130     TURN ON THE VACUUM CLEANER
140     VACUUM THE FLOOR
150     TURN OFF THE VACUUM CLEANER
160     UNPLUG THE VACUUM CLEANER
170     GO TO ROOM # + 1
180     IF ROOM # + 1 = 5 THEN GO TO CLEANING CLOSET A ELSE GO TO 50
190     PUT THE VACUUM CLEANER AND DUST CLOTH IN THE CLOSET
200     SHUT THE DOOR
210     PUT YOURSELF AWAY - YOU DESERVE A REST
Now the robot has a workable list of instructions.
But let's take another look at this list. This program was written one line at a time with one instruction per line. Not being very long, it isn't very easy to get lost. But when pro­grams have hundreds of lines, it is quite easy to become confused as to the exact se­quence of the program and how it works.
Therefore, let's structure the program.
What do we really want to accomplish? What is the task to be assigned to the robot?
The job is to clean the house. To ac­complish that, the robot must get its equip­ment and proceed to clean each room it has been assigned to clean. Then it must shut itself down for the next task.
Why not write a program that way? You can in Logo — in fact, you have to. We bor­rowed from BASIC to create the first pro­grams. Now we'll borrow from Logo to demonstrate a more structured approach.
\ 20
r r
r r r r
TO CLEAN HOUSE :N
PREPARE
CLEAN :N
SHUTDOWN
END
TO PREPARE
GO TO CLOSET A
IF DOOR CLOSED OPEN
PICK UP VACUUM CLEANER AND DUST CLOTH
CLOSE DOOR
END
TO CLEAN :N
GO TO ROOM :N
PUT DOWN VACUUM CLEANER AND DUST CLOTH
EMPTY
DUST
VACUUM
GO TO :N + 1
IF :N + 1 = 5 SHUTDOWN
END
TO EMPTY
CHECK ASHTRAYS
IF CLEAN DUST
EMPTY ASHTRAYS AND WASTEBASKET INTO GARBAGE
CAN ON BACK PORCH
RETURN TO ROOM :N
END
TO DUST
PICK UP DUST CLOTH
DUST FURNITURE AND SHELVES
END
TO VACUUM
PUT VACUUM CLEANER PLUG INTO ELECTRICAL OUTLET
TURN ON VACUUM CLEANER
VACUUM FLOOR
TURN OFF VACUUM CLEANER
UNPLUG ELECTRICAL CORD
END
TO SHUTDOWN
GO TO CLEANING CLOSET
IF DOOR CLOSED OPEN
PUT VACUUM CLEANER AND DUST CLOTH AWAY
CLOSE DOOR
PUT YOURSELF AWAY - YOU DESERVE A REST
END
This procedure starts with a definition of the problem. TO CLEAN HOUSE :N. The goal is to clean the house starting with room #N. The robot has to prepare itself for the job, accomplish the job, and then shut itself down.
21
r r
r r r r
The next step is to CLEAN :N, to clean the house starting with room #N. The procedure first takes the robot to the required room and sets him up for the job. Then the EMPTY procedure is called. If the ashtrays and wastebasket are clean, the procedure immediately calls DUST. Otherwise, it moves on through the task. Vacuuming follows the dusting, and then on to the next room. The robot finally gets his rest at the end.
Consider the analytical process for generating this simplistic procedure. Consider the think­ing steps required to analyze the problem, break it down into its simplest elements, and then reconstruct the procedure into a workable program.
In short, think of the lessons in thinking that are possible through such exercises.
You have just scratched the surface of Logo.
22
Digging Into Logo
Scratch the surface of Logo and what will you really find?
For one thing, you'll find a fun-type computer language for children. Very young children enjoy using its friendly, plain English messages and interactive graphics, just as college students enjoy exploring its mathematical and list processing depths.
You'll also find a popularized philosophy of education. Just as there are different ver­sions of the language, each developing its own devoted following, there are different inter­pretations of the philosophy, each with its own congregation of believers. We'll leave the mathematical theories to the professors and the educational philosophy to the philosophers. We'd rather play with the kids!
Watch a kid at a computer! Watch the intense concentration! Watch her explode in un­controlled glee as her program runs perfectly for the first time. To uninitiated adults, this can be a very intimidating experience.
Is the computer some form of cybernetic Pied Piper captivating children's minds? Or is it, indeed, a valuable learning tool?
And where does Logo fit into this?
Logo is an enjoyable computer language reminiscent of the game of chess. And like chess, it can be used as a valuable learning tool, or it can merely be just another computer language.
Very young children can quickly learn the basic chess moves and enjoy playing the game. Then they can spend the rest of their lives exploring the intracacies of chess, discovering new opening, middle, and end-game strategies.
Business schools and military colleges have long accepted the value of chess as an educa­tional tool. Fundamental to the learning process is the physical act of strategically moving pieces around the board, exploring and experiencing different combinations of moves, and their possible consequences, in a structured, competitive environment.
23
Just as it is fun to play chess, it is fun to "play" the computer. It is fun to start with what you know, and then discover new things you can do with that knowledge and experience. It is fun to first create simple shapes and then assemble these into increasingly complex drawings.
Logo is a very friendly, structured, procedural language through which users become very actively involved with the computer after only a few minutes of indoctrination. While en­joyable and exciting to the very young, Logo is a limitless language. If you want the com­puter to do something, you simply teach it how. However, the preconditioning of many adults will simply not allow them to accept such a simple, seemingly infinite concept.
Einstein once stated, "Imagination is more powerful than knowledge.'' Programming in Logo is a fascinating exercise in imaginative thinking. Imaginative thinking doesn't mean fanciful dreaming at the computer. Rather, it refers to true creative thinking where mathematics, geometry, logical operations, and list processing become tools for discover­ing new intellectual growth opportunities.
Where other programming languages have finite lists of commands which cannot be ex­panded, Logo uses simple primitive commands with which the user can define an entirely new language. Logo variables can be numbers, character strings, or lists. Logo procedures become new Logo commands which can act independently and "talk" to one another, one acting at the command of another.                                              ~f*3L
-
1 1
i
Probably the most exciting feature of Logo is its interactivity. Whatever the user enters on the keyboard happens on the screen immediately, whether it is a command or an entire procedure. It is this interactivity that helps young people see and feel the complex con­cepts with which they are working.
Since early 1981, the Young Peoples' LOGO Association has thoroughly enjoyed teaching Logo to young people. It has been exciting watching them walk through Turtle exercises to help them visualize what was happening on the screen. This ability to visualize was dramatically demonstrated through a simple experiment we conducted.
In August of 1981, after young YPLA Turtles ranging from 6 years to 10 years of age had been using Logo for several months, they were asked to draw various angles on blank paper.
1 i
"Draw a line. Then have the Turtle make 217 Turtle Turns, and draw another line. Where would the Turtle be heading?"
24
We gave the youngsters several random angles to draw. We then presented the same challenge to some electronics engineers who used computer-aided design facilities daily. The engineers were the first to admit that the youngsters won. While their lines were not as straight, their visualization of the angles involved was more accurate than the "guesstimates" of the engineers. Even though the engineers had many more years of training and experience, their conditioned reliance on other tools inhibited their free, creative thought processes.
Later, we began teaching parents and teachers about Logo and Turtle Geometry. This proved to be an even more enjoyable learning experience. The first problem was getting the adults to actually touch the computer. It was fun to watch them jump excitedly when things began to happen for them. We also found, not too surprisingly, that it was even more fun watching them twist and turn in front of their computers as they tried to emulate the Turtle. Arms would wave and fingers would point as they tried to make the abstraction of the computer screen a more real, more readily visualized experience.
If you think children do some funny things, you should have seen some of these antics.
It is these "antics" off the computer that help to make Turtle Geometry come alive. Children, in particular, need the learning experience of tur­ning and moving their bodies and other concrete objects through geometric planes. They seem to absorb information through their moving fingertips.
Logo provides children and adults alike with a descriptive computer language through which they can tell the computer how to structure their own combination of moves, and then explore how to extend them into increasingly more complex operations. When their descriptions are inadequate — a bug in the program — the computer simply doesn't do what they expected. Then they must rethink their descriptions and try again.
It is this rethinking process — the debugging of procedures — which helps children become clear, precise, logical, and confident thinkers.
We have seen some children who, after a couple of years with Logo, have become brilliant typists - but that's all! Their fingers flash across the keyboard as trucks, planes, and rockets whiz by in dazzling displays of color. But within all of this was not one original program element or thought.
On the other hand, we have enjoyed watching kindergarten children sit at the computer and develop graphic displays in their mind's eye. They structure their own procedures and then verify their logic by running the program.
Both children know the language and know how to program. The first is the hare. Learning Logo has been the end unto itself. There has been no thought given to synthesizing or ap­plying this knowledge. The second is our Turtle. Logo and the computer have merely been the tools to discover the fun and excitement of creative thinking. It is from this fun that intellectual development will grow.
25
And all types of children can benefit.
A unique bit of magic permeates the room as a developmentally disabled youngster watches his procedure run for the first time. There is a beautiful serenity which envelopes those watching a hyperactive child pouring over his procedure hour after hour with never a break in concentration.
The most important aspect of this learning environment is that possibly for the first time in their lives, these children are in control of their own destiny. Where once there was a self-destructive, totally negative attitude about learning, these children can move at their own pace, in their own good time. They make the decisions, their own success or failure. Far more importantly,
THE MEASURE OF THAT SUCCESS IS THEIR OWN.
One small triumph at a time, and without fear or embarrassment in front of peers or teachers, they develop their own sense of accomplishment. Certainly this takes time. But the computer is very patient.
This is the hope of tomorrow — young people riding into the future on the back of a Tur­tle. Should this sound overly emotional or exaggerated, give it a try.
C'mon. Join us. Be a Turtle!
26
CHAPTER 2 TURTLE COMMANDS
Throughout this book, there are off-computer activities to help make some very abstract concepts come alive for youngsters. They will be easy to spot by the Turtle turning a cart­wheel or other off-computer illustrations. Also watch for the Special Note Turtle. He has important information for you.
Ready? Let's get started! Type TI                         TELL TURTLE
APPLE                SHOWTURTLE or just ST
MIT                     DRAW
The Turtle is the little triangle in the center of the screen. The first four commands you will use are
FORWARD or FD
BACKWARD or BK
RIGHT or RT
LEFT or LT
27
Each of these commands must be followed by a space and a number. The number tells the Turtle how far to go or how much to turn. Every time you give the computer a com­mand, you must press
TI                         ENTER
or
APPLE                RETURN
To CLEAR your SCREEN and start over, type CLEARSCREEN or just CS. To get the Turtle back to the center, type HOME. To erase a typo
TI 99/4               Hold the SHIFT key down and press T
TI 99/4A            Hold the FUNCTION key down and press 3
APPLE                Use the left arrow key
MIT                     Press the ESC key
Before you go any further, experiment with these four commands and various inputs. You might explore the parameters of the screen. How many Turtle steps to the top? The bottom? Either side?
Sometimes you'll see a message like this: TI                         TELL ME HOW TO_________________________________
APPLE I DON'T KNOW HOW TO
MIT                  THERE IS NO PROCEDURE NAMED
There is probably a typo in your command. Simply retype it and press ENTER or RETURN.
Take a Turtle Walk
Taking a Turtle walk is a fun way to become familiar with the movements of the Turtle. Have one child be the Turtle while several others take turns giving out commands (FORWARD, BACK, RIGHT, LEFT). Be sure there is plenty of walking space. When you first in­troduce the Turtle walk, FORWARD and BACK might be followed by a certain number of baby steps since the Turtle takes very small steps. LEFT and RIGHT would mean a 90- degree turn, which is a natural movement to make if someone says, "Turn to your right/', or, "Look to your left." As the children become more familiar with angles and begin to recognize the difference between a 30-degree angle and a 90-degree one, you can add the clock concept to the Turtle walk (described later in this chapter).
28
TURTLE COMMAND
FORWARD
FD
BACK
BK
LEFT
LT
RIGHT
RT
-
1
MORE TURTLE COMM
SHOWTURTLE ST
HIDETURTLE         HT
00
HOME
CLEARSCREEN CS
1
r r
The Blind Turtle
Put a blindfold on the child who is playing Turtle and arrange the desks or dining room chairs in a maze. If the Turtle follows the commands exactly, he won't bump into anything, but he'll have to listen carefully and obey exactly.
<jjU0C5»?
ttlMCHUGKIM
r
r
r
r
r r
Big Trak
Big Trak™ is a programmable electronic toy manufactured by Milton Bradley Company and sold for about $50. It is an excellent introduction to the LOGO Turtle. Children can program this floor tank to move forward and back and to turn right and left. Just as in the Turtle walk above, the children can experience Turtle commands in a concrete way. It then becomes easier to figure out what commands to give to the LOGO Turtle to make it perform specific tasks.
In addition to off-computer activities, there are several activities you can use with children to help them begin playing and experimenting with various commands and inputs. Here are a few to get you started:
1
r
Turtle Baseball
Put a colored sticker randomly on the screen and see if you can command the Turtle to get to it. After the children have practiced for awhile, challenge them to a game of Turtle Baseball. This can be played in teams or individually. Put four small colored dots on the screen, one at HOME and the other three to represent the three bases. The batter may give three RIGHT or LEFT com-
33
mands to point the Turtle towards first base and three FORWARD and BACK commands to reach it. If he makes it, he can then take three tries to aim at second base. If he misses, call the Turtle home and let the second player try. Score one point for each successful run to a base. Modify the game to fit the players. Instead of three tries, allow six. Allow two chances to run for the base — two FORWARD commands. For older or more experienced children change the position of the dots between each player's turn.
Mazes
Using a plastic overlay taped on the screen, draw a maze for the Turtle to wander through. If it's close to a holiday, put an appropriate sticker at the end of the maze.
if* Introduce Yourself to the Turtle
Have each student try to get the Turtle to draw his or her first initial. For now, block letters will do. Later you might like to try this again, adding curves and defining procedures for each letter.
Sometimes you'll want to move the Turtle without drawing. In that case, use
PENUP or PU
After you've moved the Turtle and want him to draw again, use
PENDOWN or PD
If you want to erase one line without erasing your whole drawing, use
TI/APPLE           PENERASE or PE
MIT                     PC O
After you give the command, have the Turtle go back over the line you want erased. To continue drawing, you'll have to put the pen back down with
TI/APPLE PENDOWN
or PD
MIT PC 1
Experiment with all the commands you
have learned so far
FORWARD
FD
BACKWARD
BK
RIGHT
RT
LEFT
LT
PENUP
PU
PENDOWN
PD
PENERASE
PE
(TI/APPLE)
PC 0 and PC 1
(MIT)
HOME
CLEARSCREEN
CS
Which ones must be followed by a number?
34
r r r r r r r r r
i
r
1
Q.
a
a.
a
</>
0)
<
5
o a
>
3
a
a
a.
a
a.
Q.
<
35
-
1
1
J
PENCOMMANDS
PENUP              PU
PENDOWN         PD
PENREVERSE    PR
PENCOLOR O     PCO
(PENCOLOR 1 TO RESTORE DRAWING)
MIT
-
-
1
:
You are now ready to begin working with some basic shapes. Let's start with a square.
Body Geometry
Have four children make a square with their arms. Each child should stretch one arm directly in front of him and the other arm directly to the side. He should be looking straight down the arm in front towards the next child. Have a fifth child walk around the square describing his moves as he goes. Before a child has worked through the worksheet and discovered that the turn is a 90 degree turn, the child's description might be something like Forward six steps, turn right, forward six steps, turn right..." Once they all have discovered the 90 degree turn, have them repeat the body geometry exercise with a more complete description: "Forward six steps, turn right 90, etc." Then ask the question, "IF you are looking down the arm in front of you, how much do you have to turn your head to look down the other arm?" Ah ha, 90 degrees!
If children "walk a square" first, they know the Turtle will have to go FORWARD four times and turn RIGHT or LEFT four times. Have one child write the commands on the board:
FD____
RT FD RT FD RT FD RT.
tf*g_
That last RT command causes the Turtle to end up facing the same direction as he started which will become more important as we progress.
In working with children, it is much more powerful for them to figure out for themselves that the Turtle must turn 90 degrees to make a square than it is to be told. The element of discovery cannot be overemphasized. On the next page is a worksheet on squares that can be used to guide their exploration.
39
NOTES
40
WORKSHEET ON SQUARES
If you were the Turtle, how would you draw a square? EXPERIMENT: Since we need to figure out how much to turn to make a square corner, keep the FD number the same each time and just change the RT number.
FD50
RT____
FD50
Does it look like a square corner? (Also called a right angle even though you can make one by turning left.) If it doesn't look like a right angle, clear your screen and try again. Write down the numbers you try and whether they were too big (turned too much) or too small (didn't turn enough.)
_was too______                 ____was too.
_was too______                 ____was too.
.was too______                 ____was too.
.was too______                 ____was too.
The Answer is________///
41
1
-
-
When you are drawing, there are times when you might want the Turtle to disappear. For example, you might want a square without a little triangle in the corner. Use the command
HIDETURTLE or HT
To make him reappear, use
SHOWTURTLE or ST
Examine the sequence of steps you used in drawing a square. Do you see a pattern? When a pattern appears, there is usually a shortcut you can use. In this case, the shortcut is called a REPEAT command. REPEAT must be followed by a space and a number that tells the Turtle how many times to repeat the command contained within brackets.
Do not confuse the brackets with the parentheses. Be sure to use: TI 99/4               SHIFT 4 for [ and SHIFT 5 for ]
TI 99/4A            FNCT R for [ and FNCT T for ]
APPLE                SHIFT N for [ and SHIFT M for ]
The command will look like this:
REPEAT 4 [FD 50 RT 90]
When introducing the REPEAT shortcut, you might write the command on the board with blanks where the numbers are. Have the children tell you what numbers to write in the blanks by asking questions.
REPEAT: How many times will the Turtle have to go forward and turn to make a square? (How many sides does a square have? How many corners?)
FORWARD: What does the FORWARD number do? Can we use any number we want for FORWARD? What number should we use if we want a small square? What if we want a big square?
RIGHT: How much must the Turtle turn to make a square corner? Can we use LEFT instead of RIGHT?
Try lots of experiments. Make big squares and small squares. Using the PENUP (PU) and PENDOWN (PD) commands, try putting various sizes of squares all over the screen. Try putting a small square inside a big square. Use the following square worksheet for prac­tice with the REPEAT shortcut.
43
NOTES
WORKSHEET ON SQUARES USING REPEAT
Write down the short command for drawing a square:
REPEAT______[FD______RT______]
Draw four squares in a row and write down the commands you would use:
m
Draw two squares on top of two other squares and write down the com­mands you would use.
p
I i I
Draw the following shapes using the REPEAT command as often as you can. Write down the commands you use:
Oil tL
LmmmmhJ
<£>•• C5-
45
1
-
thl intrn^ ^ f'"9 J* ^T yOU may be tempted at this Point *> P^ge ahead to ~™T^        prrdrS T1 Variab,eS- C°mpleX drawin9s such as the cate^illar figure
th^hnnT C°nS\dcrab^ tedium' However'* * infant to remember that the younger the child, the more dependent he is upon imitation and repetition for his learning. What is tedium for an adult is often simply practice for a child. Encourage the children to con­centrate on their work through questions that focus their attention on the similarities and differences in the figures. When they are involved in projects of their own making, you will be amazed at their patience and persistence.
ii, n !■ imJn
JL—JL ft, J
EL
47
If you feel confident with squares, let's tackle a triangle.
Body Geometry
Repeat the activity you did earlier with four children for­ming a square with their arms. Have a fifth child walk around the square and describe her movements, paying careful attention to the turns. Now have one child drop out and the remaining three form a triangle. Have the same child walk around the triangle. How does the turn for a triangle compare to the one for a square? Does she have to turn more or less?
The following worksheet will help children discover for themselves the angle the Turtle must turn to draw a triangle. When they think they've found it, have them hide the Turtle (HT) to make sure the third line meets the first. Sometimes someone will get close (119 or 121) and think they've found it. To check it out, give another FORWARD command. If the turns are correct, the Turtle will retrace the first line of the triangle.
48
WORKSHEET ON TRIANGLES
Can you figure out the turn the Turtle has to make to draw a triangle? FD50 RT____
FD 50         ,(Use the same number for all three turns)
RT___
FD50 RT___
Write down the numbers you try. If the numbers are too big, the third line will cross the first. If they're too small, the third line won't meet the first.
was too
was too
____was too_____
____was too______
____was too_____
____was too______
____was too_____
____was too______
The A
nswer
is___
iff
• •
Now write the REPEAT command for a triangle:
REPEAT.
[FD.
RT.
-]
Experiment with drawing big and small triangles and combining triangles to make various designs. Remember to keep notes of what you do.
49
J
-
1
-
Once the children have had plenty of time to experiment with triangles and squares and with just plain "doodling," they will begin to recognize different sizes of angles. Now would be a good time to introduce. . .
The Clock Concept
Draw a chalk circle on the floor. Mark it off with numbers as on a clock. Have one child stand in the center facing 12 o'clock. If she turns 90 degrees to the right, she is facing 3 o'clock. Sup­pose she only turns to 1 o'clock? One-third of 90 is 30 degrees. Where does she end up if she turns left 90 degrees from 12 o'clock? 9 o'clock. How much of a turn does she have to make in order to face 6 o'clock? She can either go right 180 degrees or go left 180 degrees. Either way she ends up facing exactly op­posite the direction of 12 o'clock.
Now suppose she is facing 6 o'clock and turns right 90 degrees. Where does she end up? 9 o'clock. It is important to point out that the Turtle will respond the very same way — the way it turns depends on how it is facing. If the Turtle is facing the bottom of the screen (6 o'clock) and the child tells it to turn right 90, it will turn to face the left side of the screen (9 o'clock). The Turtle turned to his right, not the child's.
Walnut Turtles
As children try to figure out which way the Turtle should turn, they may twist and turn and almost stand on their heads to get in the same position as the Turtle. Sometimes it helps for them to have a Turtle they can hold and turn and move around through various shapes and designs. They can make their own out of walnut shells and construction paper.
Carefully crack open the walnuts so you don't break the half-shells. These will become the turtle shells. Place one half-shell down on construction paper or cardboard and trace around it. Draw a head, four legs, and a tail, out from the body. (Or copy the page of "Turtle bodies" we have included for you.) Cut out the body and glue it on the walnut shell. Presto, one happy little Turtle you can command around the table top with forward, back, right and left! For pre-schoolers, you might want to consider larger Turtles made from the sections of egg cartons.
One way to use the Turtle is to move him through various shapes. Draw a triangle and move the walnut Turtle along the outline. Does he turn right or left? Try it with some more shapes.
In addition to the walnut Turtle, there is a pattern for a Turtle clock. Each child can make a clock of his or her own. The activities we have talked about with the clock concept can now be modified for use with the smaller individual clocks. Place the walnut Turtle in the center and point him towards 12 o'clock. When he turns to face 1 o'clock, how many degrees did he turn?
51
How about designing a neighborhood on butcher paper for the Turtle to travel through. Can the children figure out how to command their Turtles (using forward, back, right, and left) to go from home to school, to the grocery store, to the library and back home? We've included one Turtle map just to get your imaginations going.
Body Geometry With the Clock
Have three children form a triangle again. If you look down one arm and imagine you are looking at 12 o'clock, what number would you be facing if you turn and look down the other arm?
Uh oh! On the triangle worksheet, we figured out that we would have to have the Turtle turn RT 120 to make a triangle. Now it looks like the angle is only 60 degrees. How can that be? Remember the Turtle turns from the direction he is facing, not the way you are facing. If he were going to draw the angle you are making with your arms, he would start at the finger tips of the arm you are facing and move forward to your chest. He is facing exactly the opposite direction you are. Exactly the opposite =180 degrees. You know that the angle is 60 degrees, but since he is facing the opposite direction he will have to turn 180-60 (or 120) to turn and go down your other arm.
The Clock on the Computer
To reinforce the clock concept with its 30 degree turns, write the numbers 1 -12 on small stickers that can be put on the screen. With the Turtle at HOME, have one child tell the Turtle to go forward 50 and back 50. The number 12 sticker should be placed on the screen at the top of the line the Turtle just drew. Have another child turn the Turtle RT 30 and then go FD 50 and BK 50. The number 1 sticker should be placed at the end of this line. Take turns giving the commands RT 30 FD 50 BK 50 and placing the stickers until you get all the way around to the original position. Did they get all 12 numbers on the screen? Does it look like a clock?
52
53
1
-
-
"URTLE TOWN
rn^^m^M ^v^qndv
rC3b
57
-
1
i
\
-
--
r
r
r
61
:
i*^^
Logo Sports
Sports games are one of the easiest ways to get young people actively involved with think­ing about Turtle Geometry exercises. You can start with baseball, pasting stickers, an overlay, or other marks on the screen to indicate a baseball diamond. Then children can be challenged to "run the bases" within their three outs. The bases can be placed at regular angles or at totally random angles.
Football is a game to help "teams" work together to thwart their opponents.
There are innumerable variations to be made using sports games and other simulations on the screen and off. These exercises help children more readily visualize the concepts of Logo and Turtle Geometry.
Have the children develop their own rules and write them down in their "rulebooks." Let them set the conditions of play.
Most importantly, let the children discover the innumerable opportunities these sports games offer for exploration of the computer's and their own capabilities.
63
--
TURTLE BASEBALL
r
r
r r
r
r I
I
r r
TO BALLFIELD
PU BK 60 RT 45 PD
REPEAT 4 [FD 120 LT 90 REPEAT 4 [FD 10 LT 90]]
FD 200 PU BK 200 LT 90 PD
FD 200 PU BK
200 RT 90
PD FD 10 LT 45 FD 60 LT 90 FD 6
REPEAT 90 [FD 1 RT 4]
FD 7 LT 90 FD 60 HT
END
1. Start with a regular ballfield and try to guess the proper distances and angles to get safely around the bases.
If the batter guesses the proper angle and runs along the base line passing first base, that is a single. If the batter guesses the correct angle but does not reach first base with the first guess of the distance, he is out.
(continued on back page)
65
TURTLE BASEBALL (continued)
If the batter reaches first base with a single, the next task is to get home safely. The correct distance between bases must be calculated. The next task is to write the procedure or command which will take the base runner home. If the base runner goes outside of the base line, that is an out.
Each player gets three outs in an inning.
2.    To add some challenge to this game, draw an irregular baseball diamond with different angles and distances.
3.    As the players progress through the various commands of Turtle Geometry, you can add all sorts of variations to the game.
Draw the baseball diamond on the lower portion of the fullscreen. Place small rectangular shapes in the outfield. The objective is for students to guess the angles and distances and send their "hit" into one of these boxes. Larger boxes represent singles and doubles. Smaller boxes repre­sent triples and homeruns.
To add more of a challenge to the game, have the players estimate the X-Y coordinates of the scoring boxes and direct their "hit" by coor­dinates rather than by merely sending the Turtle off in that direction.
For more variation, add some boxes on the field to represent "flyed out." Have the players write a random procedure to determine if the long ball was caught for an out or not.
66
TURTLE FOOTBALL
TO FOOTBALL
HT PU BK 50 LT 90 FD 120 RT 90 PD
REPEAT 22 [REPEAT 2 [FD 5 RT 90 FD 20 RT 90] FD 5]
RT 90
REPEAT 10 [FD 20 REPEAT 2 [FD 20 RT 90 FD 110 RT 90]]
FD 20 RT 90
REPEAT 22 [REPEAT 2 [FD 5 LT 90 FD 20 LT 90] FD 5]
END
1. This is a game which works well with two players or teams. Have the defense position their eleven players on the playing field anywhere they want to position them. Each player can be represented by a small square drawn by the Turtle. Players can also be drawn on clear overlays, or with eraseable markers. The offense is then given four "downs'* to program a path from one end of the field to the other without running into any of the defensive players.
2. Place stickers, overlays or Turtle-drawn boxes on the screen. If the offense can direct his Turtle to the mark, this can represent a long pass. The longer the pass, the smaller the mark should be.
3.  If a player fails to make a touchdown in three downs, the fourth down can be a Kick. The kicking team must set the coordinates where the ball will land. Or they can merely direct the Turtle to move the ball to a location downfield. The defense can be given the chance to set their receivers so as to run the ball back.
67
r
r r r r
CHAPTER 3 DEFINING PROCEDURES
Using the REPEAT command saves time, but it still takes a lot of typing especially if you're working on a complex design that has several simple shapes in it. If you are going to draw a windmill that is made up of four triangles, wouldn't it be much simpler to type "TRIANGLE" or even "TRI" every time you need another triangle than it would be to type REPEAT 3 [FD 40 RT 120] everytime? If you agree it would be easier, you are ready to learn how to define procedures and how to use the "edit mode."
Please remember that a procedure should not be defined until a concept is understood. For example, the concept of squareness involves the recognition that a square has four equal sides and four equal angles and that the measure of the angles is 90 degrees. This recognition is the basis for writing the procedure. The "shortcut" nature of procedures fre­quently tempts children to work in that mode before they are ready, i.e., before a concept is well formed. They should be encouraged to take all the time they need to use the screen as a scratchpad and simply "doodle" with the Turtle.
If they're ready and you're ready, let's start with a square which we'll simplify even fur­ther by calling it BOX. Type
TO BOX and press ENTER or RETURN
TI When you press ENTER, the screen turns green and the cursor is just to the right of the first line. Press ENTER again to get the cursor down to the next line. Now type the instructions for making a square. The screen should look like this
TO BOX
REPEAT 4[FD 40 RT 90]
END
-
r
r r r
To leave the edit mode
TI 99/4               Use SHIFT Z
TI 99/4A            Use FNCT 9
You have now defined a procedure named BOX. Type BOX, press ENTER, and see what happens.
APPLE When you type TO BOX, you'll notice that the cursor changes from ? to > . Type in the instructions for making a square and press RETURN. Then type END and press RETURN. You'll see the message: BOX DEFINED. Type BOX and see if it works.
MIT When you press RETURN, the screen changes. TO BOX is at the top lefthand corner and the cursor is on the next line. Type the instructions for making a square. Press RETURN. Type END. To leave the edit mode, press CTRL C. You will see PLEASE WAIT... followed by BOX DEFINED. (Note: If you make a typing error in the edit mode, use the arrow keys to place the cursor on the character you want to erase. Press CTRL D to delete.)
69
Editing
If a procedure does not run as expected, it's no big deal. Combine a little rethinking with a few editing skills and make whatever modifications you want. Suppose you want a smaller square or a larger triangle. In that case:
TI
Type TO
(the name of the procedure)
99/4
Hold the SHIFT key down and use the right arrow key to get just past the word or number you want to erase. Use SHIFT T to erase. Then type in the new word or number. Press SHIFT Z to leave the edit mode.
99/4A            Hold the FNCT key down and use the right arrow key to get just
past the word or number you want to erase. Use FNCT 3 to erase. Then type in the new word or number. Press FNCT 9 to leave the edit mode.
APPLE
Type EDIT "_
_(the name of the procedure you want to
edit). Use the right arrow key to get just past the word or number you want to erase. Use the left arrow key to erase. Then type the new word or number. Press CTRL C to leave the edit mode.
MIT
Type TO______
_(the name of the procedure you want to edit).
Use the arrow keys to place the cursor on top of the characters you want to change. Use CTRL D to erase. Then type the new characters. Use CTRL C to leave the edit mode.
As you progress in writing procedures, there are other editing features to learn. See Appendix A. For now, these will probably be sufficient.
Saving Procedures
The procedures you are defining will be very helpful in drawing more complex designs and pictures so you'll want to save them on a disk or cassette tape. Please refer to your Operator's Manual for complete instruc­tions on how to do this.
70
SQUARES WORKSHEET-2
DRAW A FLAG. Write down the commands you would use to draw a flag and then write a procedure for drawing a flag.
i
DRAW A WINDMILL. Using the flag procedure you just defined, write a procedure for drawing a windmill.
ri
n
u
DRAW A PINWHEEL. Use the flag procedure or the windmill procedure to write a new procedure for a pinwheel.
71
-
r
r
r
r
r r r r
Big Trak
Just as you can program the Turtle to draw a square, you can also program Big Trak to move in a square. The only difference will be that Big Trak's rotation through a circle is 60 turns (rather than 360). Thus, its right angle will be 15 rather than 90. This doesn't seem to be a problem for children. They are able to go back and forth between Big Trak and the computer, recognizing and taking for granted that some commands will be slightly different.
i
r rr i r r r r
After the children have become familiar with Big Trak's movements, set up a maze on the classroom floor and challenge them to make the truck move through it. The simplest way is to use masking tape on the floor. Or you could use building blocks, chairs, tables, etc. Big Trak can also be programmed to move through various geometric patterns such as a square, a triangle, or a circle. You can be quite imaginative in the things you teach Big Trak. The "boogie" is one such program. Simply program the machine to make a series of small turns to the left and then back to the right. The result is a dancing truck that can't help but make you laugh.
If you have a learning center, you might consider making up playing cards for a Big Trak game children can play independently. Cards might read "Go forward 10, turn in a com­plete circle, and back up 10," "Program me to move in a square," "I can't decide where to go. Make me go forward, back, right, left, and back to where I started," etc. As the children learn more shapes, add new direction cards.
Back to the Computer
After the children have experimented and played with squares, have them define a triangle. Type TO TRI and press ENTER or RETURN. Type the instructions for a triangle follow­ing the same process you did for the BOX. (You can call these procedures anything you want. The shorter and the simpler name you give it, the easier it is to type commands. This is extremely important if you are working with young children.)
73
String Toss
This activity is especially helpful when used in con­junction with the following triangle worksheets. Draw a chalk circle on the floor and mark it off like a clock as you did earlier. Position a child at each one of the numbers and one in the center with a ball of string or yarn. Another child could be used to write down the movements and another could be at the computer giving the Turtle the same commands. Use the string to make designs inside the circle. Begin with an hourglass pictured below.
Since the Turtle always starts by facing up or 12 o'clock, the child should also begin by facing 12 o'clock. If he turns to 11 o'clock, how much does he turn? Turning from one number on the clock to the next number is always 30 degrees. Thus, the first command is LEFT 30. The center child should hold the end of the string and toss the ball to the stu­dent at 11 o'clock. That child should hold the unraveled string and toss the ball to 1 o'clock, who in turn tosses it back to center. There is now a triangle formed with string. But on the computer, rather than repeating each movement separately to the Turtle, we have a defined procedure that will tell him to make a triangle. Thus the second command to the Turtle is TRI. When the Turtle draws a triangle, he ends up facing the same direction that he started, so at this point the center child should be facing 11 o'clock again. He will have to turn and face the opposite direction before starting the second triangle. Exactly opposite equals a 180-degree turn, either left or right.
Once the children have made an hourglass with string and on the screen, have them define a new procedure called HOURGLASS. Using HOURGLASS (both with string and with Turtle), see if they can make a windmill and then a hexagon.
String Art
Using scrap lumber, nails, and the same clock principle, you can make an inexpensive string board to help children work out "Turtle trails." Draw a circle on the board and mark it off like a clock. Hammer a nail into each number and one into the center. Use yarn or string to make various designs and then try to match them on the screen. This activity, designed for children working individually, is similar to the preceding class activity.
74
TRIANGLES WORKSHEET-2
DRAW A FLAG. Using the triangle procedure to draw a flag. Then define TRI.FLAG as a new procedure.
DRAW AN HOURGLASS. Write a procedure to draw an hourglass.
X
DRAW A WINDMILL. Using the hourglass procedure, write a procedure to draw a windmill.
HOW ABOUT A DIAMOND? Can you put two triangles together like this to make a diamond?
0
75
1
-
TRIANGLES WORKSHEET-3
Now that you know how to make a triangle, see if you can make a hex­agon by putting six triangles together.
First figure out how to put two triangles together. Experiment.
TRI
RT
TRI
If the number is too small, the triangles will overlap.
If the number is too large, the triangles will not touch.
.was too_ .was too. .was too. .was too.
_was too. .was too. .was too. _was too.
The Answer is
ft!
When you find the right number, write a procedure for making a hexagon.
r
r
'M^/h
\Vi X^
77
-
TRIANGLES WORKSHEET-4
Can you figure out how to draw this flower? Using a trace-around triangle, try drawing it with pencil and paper first. Without lifting your pencil, trace around the triangle, rotate the triangle and trace around it again. Keep rotating and tracing until you have drawn the flower. Pay attention to the turns you make so you can tell the Turtle to do the same thing. How many times do you have to rotate the triangle? How far does the Turtle have to turn before he starts drawing each one? Write down the procedure.
r r r r
r
What is the difference between the flower above and this one? Can you write a procedure for this one?
79
.
m
r r r r
r
r r r r i
r r r r
Now that you have defined BOX and TRI, use PENUP (PU) and PENDOWN (PD) to put TRIangles and BOXes all over the screen. And then let's try putting some together to make more complex designs. Start by using some off-computer activities that combine shapes.
Geoboards
The geoboard is a board with 25 pegs positioned in a 5 by 5 square as shown below. Rubber bands can be stretched between the pegs to form any number of geometric shapes. Have the children make as many shapes as they can. Identify the shapes and discuss their characteristics. Distinguish between the different kinds of triangles. Then have the children repeat the same shape a number of times to make a more complex shape such as the four-pointed star from four triangles. What is the shape in the center?
Combine two shapes, then three. Copy the shapes on geoboard paper. Now make a real­ly elaborate design. Is there a pattern? What are the different shapes involved? Think about what would be involved in teaching the Turtle how to make your design.
1^1 •
V/ N
V
81
Tangrams
The tangram is a Chinese puzzle con­sisting of seven pieces representing various geometric shapes. The shapes can be ar­ranged into many figures and designs. Have the children cut out the tangram pieces. (Whenever they cut things out or draw figures, insist on careful attention to the task.)
First encourage the children to examine sim­ple relationships among the figures. Use the two small triangles to make a square, a larger triangle, and then a parallelogram. Then try more complex figures; a square from two small triangles and the parallelogram, a trapezoid from two small
triangles and the square. Move progressively to more complex figures like a triangle from five pieces. Each time a new figure is discovered, have the students trace around the smaller figures that make it up. In this way they can keep a record of their findings.
After they have explored familiar geometric figures, encourage them to make "fun figures." There are many books on the market on tangram figures. Eventually they might like to pick out their favorite and teach it to the Turtle.                                           x /
Combining Procedures
The worksheet entitled "Combining Shapes" challenges you to use procedures within procedures. The rocket, for example, is made of a rectangle and two different sizes of triangles. Thus, TO ROCKET entails not only defining the shapes that make it up, but also determining the proper orientation of the figures to one another. If they are not careful, they may end up with a rocket that would never fly!
f"k
. IA1
111!
tfT
(Don't reject the
NASA Rejects
: rejects! Once a rocket is designed, it might be fun >arts and see what happens!)
» rearrange the p
82
TANGRAM PUZZLE
Reproduce on heavy paper. Cut out the seven pieces.
r r r r r r
I
r r r r r
r
83
"
]
i
-
-
COMBINING SHAPES
DRAW A HOUSE. Use a square and a triangle to draw a house. Then define a new procedure called HOUSE.
DRAW A SUBURB. Using your HOUSE procedure, define a new pro-
cedure to draw a suburb.
AA
DRAW A ROCKET. (Hint: Before you start this one, you might want to write a procedure for a rectangle.)
A
<
t>
85
-
-
-
1
1
•P
,
-
CHAPTER 4 VARIABLES
Now for some variety. If you've done much experimenting, you've probably figured out that sometimes you need small shapes and sometimes you need large shapes. Either you can write several different procedures to cover all the different sizes of squares you need,or you can write one procedure with a "variable" which will then enable you to draw small squares all the way up to great big ones. Before we learn how to do that, let's look at some concrete examples of how important variables can be.
What is a "Kid?
To show the importance of variables, take the heights and weights of all the children in the class. There will be a lot of variety. Other "variables" to talk about might include hair and eye color. "Kid" cannot be defined by height, weight, eye color, or hair color. These change from kid to kid.
Painting With Variables
Just as "kid" can't be defined by size, square or triangle or circle can't be defined with a fixed size. We need all sizes. Have the students paint a picture using only one shape. They may select a square, a triangle, or a circle, and use it as many times and in as many sizes as they want, but they must stick with one basic shape. Since we will start with only one variable in our procedures and since the emphasis is on creating with shapes, the paint­ing should be done in one color.
If we cannot define square by its size, how can we define square? Have the children figure out which numbers can and cannot be changed in the square command:
REPEAT 4[FD 50 RT 90]
Since the FORWARD number determines the size of the square, that is the number we want to change into a "variable." Rather than telling the Turtle to go FD a specific amount, we'll tell him to go forward :N. The dots before the N are a signal to the Turtle. They tell him the following letter stands for a number that can change each time the procedure is used.
87
TI
Type TO SQUARE and press ENTER. Before you press ENTER again, press the space bar and type :N.
APPLE
Type TO SQUARE :N and press ENTER.
Type the instructions for drawing a square, but instead of telling the Turtle to go forward a certain number of steps, tell him to go FD :N. Your procedure should look like this:
TO SQUARE :N
REPEAT 4[FD :N RT 90]
END
You have now defined a procedure that will require an "input." In other words, any time you give the command SQUARE, you will follow it with a number to indicate the size square you want. Type SQUARE, press the space bar, and type in a number. Experiment. Try drawing lots of squares of various sizes. Using PENUP and PENDOWN, put squares all over the screen. Then define a procedure using several different sizes of square. Here is an example done by a 7-year-old. It started as an exercise in comparing sizes of squares using multiples of 10 as inputs. From there, it evolved into an elaborate design she called MIRRORS. Notice how she defined a procedure and then used it as a "subprocedure" in the more complex design.
TO SQUARES SQUARE 10 SQUARE 20 SQUARE 30 SQUARE 40 END
TO TABLES SQUARES LT 90 SQUARES END
1
LlLj:
txJJLI
88
TO MIRROR TABLES LT 90 TABLES END
TO MIRRORS MIRROR LT 45 MIRROR END
After the children have experimented with squares, have them write a procedure for a triangle with a variable in it. Then use various sizes of triangles in more complex procedures. Here are a couple of examples:
TOTRI :N
REPEAT 3[FD :N RT 120]
END
TO HEX :N
REPEAT 6[TRI :N RT 60]
END
TO SPIDERWEB HEX 30 HEX 40 HEX 50 END
Allow ample time for experimenting with variables with squares and triangles. The possibilties are endless, even working with only two basic shapes. Have the children look at some of the designs they drew combining the two shapes. Can they figure out how to change the procedures so they can draw different sizes of rockets and houses and other combined shapes?
Another Use For Variables
Variables can be used as a shortcut to figure out how much to have the Turtle rotate to draw specific shapes. So far we have work­ed with a three-sided figure and a four-sided figure. Let's take a look at two different five-sided figures, a star and a pentagon. Using pen­cils and rulers, have the children draw the diagonals on the pen­tagon on the Star Gazing worksheet. By drawing the diagonals, they will draw a perfect five-pointed star. What is the shape in the center of the star? Another pentagon! Have them draw its diagonals to get a smaller star. Repeat the procedure over until the star becomes too small to work with.
89
Now how would we tell the Turtle to draw a pentagon or a star? How many times will the Turtle go FORWARD and how many times will he have to turn to make either shape?
Using the REPEAT command, they can begin to fill in numbers. First, they know the Turtle must repeat a side and a turn five times, so the command will look like this:
REPEAT 5[FD_
J?T_
J
For now it doesn't matter what size shape we draw (we're only trying to figure out the turn), so let's use 70 for each side. It's easier to figure out the rotation numbers if we work with a large shape. The command should now look like this:
i
REPEAT 5[FD 70 RT_
-]
It is the turn number we want to figure out for each shape so we'll make it a variable:
REPEAT 5[FD 70 RT :N]
-
i i
-
-
-
Now we'll define a procedure and by using different inputs, we'll be able to figure out the correct angle for both a pentagon and a star. We'll call the procedure PS, for pentagon-star. Later we'll define a separate procedure for each shape.
TOPS :N
REPEAT 5[FD 70 RT :N]
END
Now just start experimenting to figure out the numbers. Give the command PS, press the space bar, and type in a number. Keep trying until you find the numbers that will make a perfect five-pointed star and a pentagon. You'll probably have to HIDETURTLE (HT) to see if the last line touches the starting point. The Pentagons and Stars worksheet caii be used to discover both shapes. Once they have figured out how much to turn, have children define procedures for each shape. The procedures should include a variable that will enable them to draw all sizes of stars and pentagons.
90
STAR GAZING WORKSHEET
Draw the diagonals in this pentagon and discover a star! What is in the center of the star?___________________
Draw the diagonals of the new pentagon to discover a smaller star. Con­tinue drawing diagonals until the star gets so small you can't draw anymore.
91
-
1 1
r
r r
PENTAGONS AND STARS WORKSHEET
Can you figure out how much to have the Turtle turn to make a five-pointed star and a pentagon? Here is an easy way to figure it out. Write a procedure with a variable for the amount the Turtle should turn. Then you can try various numbers quite easily without alot of typing each time. First write your procedure:
TO PS :A
REPEAT 5[FD 100 RT :A]
END
Now experiment! Give the command PS and a number and see how close you are to drawing either a star or a pentagon. Write down all the numbers you try. Hide the Turtle so you can see if the last line meets the first one.
I tried these numbers:
r
r r
The Answer is________for a star
The Answer is________for a pentagon
Can you write a new procedure for a star? Can you include a variable so you can make any size star you want?
TO STAR :X
REPEAT____[FD____RT____]
END
How about a pentagon?
""                                                 TO PENTAGON :X
REPEAT____[FD____RT
                                                  END
93
1 1
Another String Toss
Have 12 students form a circle facing the center. The students represent points of a cir­cle. How many points are needed to make an equilateral geometric figure. At least three. If, as before, you imagine that the circle is a clock, each student represents a number. Start the string at 12. The student holds the end of the string and passes the ball to 4. Three students have been skipped. The student at 4 passes the ball to 8, also skipping three students. 8 passes the ball back to 12. How many students were skipped?
Start the ball at 12 again and this time skip two students as you pass it around the circle. What is the resulting figure? Try the same activity skipping one student each time and then skipping no students. The figures you have made so far are a triangle, a square, a hexagon, and duodecagon. Are there any other equilateral figures possible in this circle? What if you skip four students each time? Interesting! How would you teach the Turtle to make this figure? Remember what you did earlier with the star? This figure involves the same idea. Try making it again and keep track of how many times you go around the circle before completing the figure. Multiply the number of times by 360 to find the total angle through which the Turtle should turn. Then divide that number by the number of angles in the figure.
After you explore a circle with 12 points, try one with 20 points. How about one with 16 points. You might want to draw the figures you make on the accompanying worksheet. There are some circles with 8, 10, 12, and 16 points. Have fun!
Using Two Variables
All of these explorations with the rule of 360 may have suggested a simply wonderful (wonderfully simple??) LOGO procedure to you. We can define a procedure with two variables that will draw any equilateral geometric figure for you:
TO POLYGON :R :S REPEAT :R [FD :S RT 360/ :R] END
The computer will divide whatever number we choose for the REPEAT into 360 to find out how much to turn. Try it with several numbers. If the figure is star-shaped, you will have to change the number 360 to its appropriate multiple. (Since TI LOGO does not have floating point math, you may only use numbers that divide evenly into 360.)
Play around with this procedure. You'll be seeing variations of it later on.
95
Rule of 360
There is another important relationship we have been hinting at. Have the children add the turns in the square: 90 + 90 + 90 + 90 = 360. Add the turns in the triangle: 120 + 120 + 120 = 360. Recall the clock concept. Each time the Turtle turns from one number to the next, he turns 30 degrees. If he turns through all 12 numbers on the clock, he turns 12 x 30 or 360! What about the pentagon?
Does it work for the star? 5 x 144 = 720. No, it doesn't. But wait! 720 is 2 x 360 so there is still a relationship. And the star is the first shape we've drawn in which lines cross each other. Maybe that's a clue. Let's experiment and see if we can figure this out.
We just found out that the star procedure is
REPEAT 5[FD :N RT 144]
If the Rule of 360 works for shapes in which lines do not cross each other, to draw a pentagon, the turn should be 360/5 or 72, and we know that is correct.
It seems that we could use the Rule of 360 to figure out how much to turn for other shapes. Let's try a 6-sided figure, a hexagon. If the rule holds out; the turn should be 360/6 or 60 and the command should look like this
REPEAT 6[FD :N RT 60]
It works! Let's double the turn and see if we can draw a 6-pointed star
REPEAT 6[FD :N RT 120]
Hmm, that's interesting. Could you have predicted what would happen? What if we tri­ple the turn
REPEAT 6[FD :N RT 180]
What about an 8-sided shape, a 10-sided one, or a 12-sided one?
Try some experimenting and you'll discover that if the Turtle travels through 360 degrees or a multiple of 360, he ends in the same position he started. Use the worksheet on the following page to experiment with the various possibilities.
96
($W°$^°
Rule of 360
Fill in the correct numbers in the following chart and draw a picture of what happens on the screen. A few have been filled in to get you started. The numbers going across the first row represent the REPEAT number (the number of sides the shape will have.) The first number in each col­umn represents the turn the Turtle should make to draw an enclosed shape with the specified number of sides. The others represent multiples of the turn number. For example, to make a four-sided figure, the Tur­tle will have to turn 90. So the first number under the 4 column is 90. The second number under the 4 column is 2 x 90 or 180.
3              4              5             6             8              9            10            12
/12o\j
90
b
0
-----------—
A
/A
144
360
.....................................
_________
m
360
i
\—L ■ wwi mm i "mil
I
i
I
360
[.......................
__________
__________
97
-
-I
STRING TOSS ON PAPER
-
1
1
r
CHAPTER 5 CURVES AND CIRCLES
So far we have worked only with straight lines. If we're going to be able to draw circles, we'll have to figure out how to tell the Turtle to draw a curve. First, let's take a look at how curves can develop from straight lines.
r r
r
r r
r
If you experimented with the Rule of 360 in the last chapter, you probably noticed that the polygons which the Turtle drew became less "pointy" as the number of sides increas­ed. The angles of a triangle are much more pointed than those of an octagon. Connect the points in the figures below. As you go from the triangle to the square to the pentagon, hex­agon, etc., can you feel the increasing smoothness in the movement of your pencil?
r
r
Now get the Turtle to draw the figures one after another using a procedure with a variable angle. In the last chapter we learned how to use the Rule of 360. We know that for any polygon, the number of sides times the turn (degrees) will equal 360. So we can define a procedure to draw any polygon we want:
TO POLYGON :R
REPEAT :R[FD 20 RT 360/:R]
END
By the time the Turtle draws a 15-sided polygon, it almost looks like a circle. Why is that? Let's find out more about circles by walking around.
101
More Body Geometry
Have one child walk in a circle and describe what he or she is doing. It's not as easy to describe as a square or a triangle. Have one child play Turtle while the others tell her what to do. The instructions might be something like: "Take a step and turn a little. Take another step and turn a little more."
After several children have tried to ' 'circle" and describe what they are doing. Try it on the computer. It will go a little faster if you use the repeat command:
REPEAT____[FD____RT____]
How many times would the Turtle have to repeat the commands FD 1 RT 1 to make a complete circle? Have the class experiment with various numbers. If the first number is not high enough, keep adding to the drawing until there is a complete circle on the screen. Be sure to have the students keep track of the total number of times they repeat the com­mands. If the children have worked through all the preceding exercises, it shouldn't take them long to come up with the answer.
Have the children use the Rule of 360 to figure out other ways to draw circles.
Suppose the Turtle turns RT 10 instead of RT 1? How many times will he have to repeat FD 1 RT 10 to make a complete circle? (The REPEAT number times the RT number must equal 360.) On the following pages are two worksheets to help the students define a circle and then use it in various procedures.
102
r
CIRCLES-l
Try to figure out the missing number in this circle command:
REPEAT____[FD 1 RT 1]
First try a number and if it's not enough, keep adding to it until you make a complete circle. Keep track of how much you add to it.
I started with:
r
r
r
REPEAT____[FD 1 RT 1]
□  It made a complete circle
□  It didn't make a complete circle so I added:
REPEAT____[FD 1 RT 1
REPEAT____[FD 1 RT 1
REPEAT____[FD 1 RT 1
REPEAT____[FD 1 RT 1
REPEAT____[FD 1 RT 1
REPEAT____[FD 1 RT 1
and and and and and
r
r r
r r
The answer is
ttt
103
1
1
1
CIRCLES-2
What happens if you change one of the numbers in the procedure? See if you can figure out the missing numbers in these circle commands:
REPEAT 180 [FD 1 RT___]
REPEAT 72 [FD 1 RT___]
REPEAT 10 [FD 1 RT___]
REPEAT___[FD 1 RT 4]
REPEAT 36 [FD 1 RT___]
REPEAT___[FD 1 RT 5]
REPEAT___[FD 1 RT 2]
REPEAT 90[FD 1 RT___]
REPEAT 120[FD 1 RT___]
What happens to the size of the circle as you change the amount the Turtle turns each time? The more he turns (the higher the RT number), the_________the circle.
Choose one of the circle commands and this time try changing the FD number and keeping the other two numbers the same each time. What happens?
105
1
-
--
1
-
CIRCLES-3
SLINKY. Draw a slinky and write a procedure called SLINKY.
r
r r
r
r
r
CURVED SLINKY. Can you change the procedure slightly to make a curved slinky?
DONUT. Use the curved slinky to draw a donut. Write down the com­mands you use.
r
r
r r r
TEDDY BEAR. Using different sizes of circles, see if you can draw a teddy bear.
107
\
-
-
Circles aren't the only kind of curves. What happens if you walk in an ever-widening cir­cle? Let's try spiraling within different polygons.
r
r
Spirals From Straight Lines
This activity helps children see the relationship between straight lines and curves. Give them a sheet with the drawings of three regular polygons: a square, a hexagon, and an octagon. The midpoints on the sides of the polygons are marked. Start with the square. Connect the midpoints of the square to form a smaller square. Continue this process, marking the new midpoints and connecting them until the squares get too small to work with. Then begin shading in the triangles as in the figure below.
What begins to happen?
Do the same thing with the hexagon and the octagon. Compare the resulting figures. What is the difference? What is happening to the length of the sides? What is happening to the size of the angles? Cut out several of the triangles in the square. How do they compare? Is the same true of the hexagon and the octagon?
r
r r
r
r i
r
Now how do we teach the Turtle to spiral? One way to do it is by changing the angle. Let's use this procedure.
TO SPIRAL :A REPEAT 45 [FD 2 RT :A] END
Try an angle of 5 degrees - then 4, 3, 2. What happens if you use the angles in the reverse order?
There's a simpler way to spiral than this. However, you'll have to learn about recursion and conditional statements before you can do it. So on to the next chapter!
109
NOTES
-
1
i
k£&d
1 Jlfa
^S?
\ M^Jijtk ESS
mBmliff
wF^ftf^t^^lgf /zw
73p*
110
SPIRALS FROM STRAIGHT LINES
r r
r r
r r
r
r r r r
in
-
1
:
-
SPIRALS FROM STRAIGHT LINES
113
-
I
I
1 1
1
-
-
r
SPIRALS FROM STRAIGHT LINES
115
11
1
-
-
-
-1
CHAPTER 6 RECURSION
Recursion is one of those intimidating terms. By definition, recursion means to restate a problem or its solution in terms of itself, with each step defined in simpler terms until you reach the most easily solved statement of the original problem. A recursive Logo pro­cedure is one which calls itself, sometimes over and over again. Take a look at the two turtles drawing each other, neither one complete, each using each other to complete the task.
That's recursion. If it seems confusing, don't worry. We'll start with some very simple recursive procedures before we move on to some that are more complex. If you are familiar with BASIC or some of the other computer languages, it may seem like looping at first, but recursion is much more powerful than looping. You can use a recursive procedure to complete itself. You'll have to experience it to believe it, though, so let's get started.
Before we actually get started, let's go back to the clock on the floor.
The Clock Square
Draw a large clock on the floor and mark off the hours. Cut a piece of string twice the diameter of the circle and tie the ends together. One child should stand at the center of the clock, another at 12:00, a third at 1:30 but a few steps back from the clock face, and a fourth at 3:00. With each child holding the string, it forms a square. The child in the center is the Tur­tle at home in the center of the screen.
117
A child at the computer is going to try to type in the commands to make a pictorial representation of what happens. Thus, the first command would be to tell the Turtle to draw a square. Now the child in the center of the clock should rotate to face 1:00, the se­cond child should move from 12:00 to 1:00, the third from 1:30 to 2:30 (again, back a few steps from the clock), and the fourth from 3:00 to 4:00. The result is the rotation of a square through 30 degrees. (They should remember from the earlier clock exercises that it is 30 degrees between one number and the next. If not, review the earlier clock activities.) The child at the computer should have the Turtle turn 30 and draw the square again. The clock children should continue rotating and repeating SQUARE until they return to their original positions. The child at the computer should repeat every square and rotation with the Tur­tle. Using a REPEAT command, have them write a procedure for the design they have just created.
One way to write a procedure for the repeating square design, which we'll call FLOWER, is:
TO FLOWER :N
REPEAT 12[SQUARE :N RT 30]
END
Suppose, however, you change the amount the Turtle turns each time and now you're not sure how many times he'll have to repeat the shape to return to his original position? Using FLOWER, we'll change the RT turn and rewrite the pro­cedure to include a recursive line, one that "calls itself."
V TO FLOWER :N
SQUARE :N RT 20 FLOWER :N END
118
When the Turtle gets down to the fourth line, the one that tells him to do the procedure named FLOWER, he immediately starts to carry out FLOWER. Since he's already doing FLOWER, he simply starts over. Everytime he gets down to the fourth line, he has to go back to the beginning. He'll go on forever - or at least a long, long time. You can stop him with
TI 99/4               SHIFT Z
TI 99/4A            FNCT 9
APPLE                CTRL G
Experiment with the procedure, trying various numbers for the RT turn.
Over Under
One way to demonstrate the principle of recursion is to have the children play "Over Under." For this example we have 20 children divided into two teams of 10 each. They line up single file with an arm's length between them. The child at the front of each line has a playground ball the size of a soccer ball or smaller. On a signal to begin, the first child passes the ball over his head to the second child. The second child passes the ball through his legs to the third child. The ball continues over, under, over, under until it gets to the end of the line. The last child is in the "recursive position." He must run to the beginning of the line and start the ball over. When the first child gets back to his original position, the team should shout "STOP!" (And that's what you have to do with the Turtle or he'll keep going!)
Have the students write some other procedures that "call themselves. "Here are a few examples:
On this one, let the Turtle draw for awhile. Then stop him, turn him, and give the com­mand again.
§
TRIANGLE :N FD :N
ERECTORSET :N END
" KAAAA/MVl
119
This one looks like its name. First you'll have to define a circle.
TO CIRCLE :N REPEAT 36[FD END
:N
TO SPAGHETTI CIRCLE 5 CIRCLE 4 CIRCLE 3 CIRCLE 2 RT 45 SPAGHETTI END
Remember the POLYGON procedure we used earlier. Here is a version of the procedure with two variables: one for the length of each side and one for the angle the Turtle should turn. This time we've included a recursive line. Experiment with this procedure. What can you do with it that you couldn't do with the earlier version?
TO POLYGON :S :A FD :S RT :A
POLYGON :S :A END
120
-
You can even use a recursive procedure as a subprocedure:
TO CIRCLES CIRCLE 5 FD 20 CIRCLES END
r r
r r
r
r
TO SLINKY LT 90 CIRCLES END
TO TEPEES LT 90 TRIANGLES END
AAAAAAAAAAAAAA
TO TRIANGLES TRI 20 FD 20 TRIANGLES END
r r
r
r r
121
•r
Spirals
There is something very fascinating about spirals and it seems almost magical when the Turtle draws one. In the last chapter we learned one way to make a spiral. Now with recursion, it will be much simpler.
Drawing Spirals
There are many different shapes of spirals. Have the children draw several on the chalk board so they can become quite large.
-
1 1
7
1
-
1
Next give each child a piece of graph paper and have them draw a spiral with 90 degree angles. With the graph paper it is easy to see that each side gets just a little longer than the one preceding it.
o
-
i
122
r
r
r r r r r r r r
If the first line has a length of one Turtle step, the second would be two Turtle steps, the third would be three, etc. Each time the Turtle draws a side, he'll have to add one more step. Challenge the students to see if they can make the Turtle draw a spiral. After some experimenting they will probably come up with something like this:
FD   5
RT   90
FD   6
RT   90
FD   7
RT   90
FD   8
That's one way to draw a spiral - if you have the time and the patience. It won't take long for them to ask if there isn't an easier way to do it. Have someone write the procedure for a square (including the variable) on the board.
TO SQUARE :N
REPEAT 4[FD :N RT 90]
END
For a square spiral, we know the Turtle will have to repeat a side more than four times. We don't know how many times, but it's going to be a lot more than four, so let's break the procedure down and take out the 4. We also want a spiral rather than a square, so let's name the procedure SPIRAL. The child at the board can now begin to write down the commands for the spiral procedure. So far we have this much information:
TO SPIRAL :N (The name and the variable)
FD :N (The side)
RT 90 (The amount the Turtle must turn)
END
Since we want the Turtle to keep drawing, we need a recursive line, so we'll add one:
TO SPIRAL :N FD :N RT 90 SPIRAL :N END
Now the only thing we have to add is something that will tell the Turtle to make each line a little longer than the previous one. We can do that by adding + 1 to the recursive line:
TO SPIRAL :N FD :N RT 90
SPIRAL :N + 1 END
Now every time the Turtle goes back to the beginning, he will add 1 to the value of N. For example, if you give the command SPIRAL 12, the first FD command will tell the Tur­tle to go forward 12 steps. Then he'll turn 90. The next line tells him to go back to the top line and add one to the value of N. Now he'll have to go forward 13 steps. Each time he gets to the recursive line, he'll go back to the first command and add one more step to the distance he'll have to travel.
123
NOTES
-
-
-
1
124
WORKSHEET ON RECURSION
Using the house made from a square and a triangle, write a recursive procedure to draw a suburb. Write down the commands you use.
A A A A A A
A house doesn't always have to be a house. Can you figure out how this shape was made?
Can you write a recursive procedure to repeat the shape? Write down your commands.
125
-
i
--
Try it! It's one of those things you have to see to believe! By the way, he'll continue drawing until he runs out of ink or you stop him.
There are all kinds of fun things you can do with SPIRALS. Try changing the RT turn. Try 89 or 144. Try changing the number in the recursive line to 3 or 5 or whatever.
What if you start with a high number for the value of N, and in the recursive line you have the Turtle subtracting 1 instead of adding 1
One Final Word...
Now that you have had the chance to work with recursive procedures, it may be easier to understand the difference between recursion and iteration. Iteration is merely repeti­tion. In programming, iteration refers to those commands used to repeat an operation. Take a look at this simple BASIC program.
10 INPUT   A$
20 PRINT   "HELLO, ";A$
30 GOTO   20
40 END
This is an example of simple repetition. Line 10 asks for an input; for example, "Logy." Line 20 will then print, "Hello, Logy." Line 30 will then go back to line 20 resulting in an endless stream of lines reading, "Hello, Logy."
Another iterative approach to this same problem is the use of the FOR-NEXT loop.
10   INPUT A$
20   FOR X = 1 TO 15
30   PRINT "HELLO, ";A$
40   NEXTX
50   END
In this case, when "Logy." is entered as A$, fifteen lines appear, each reading "Hello, Logy."
It is possible to write recursive programs in Pascal, LISP, Logo, and some other high level languages. Most versions of BASIC allow some recursive routines. COBOL and FOR­TRAN do not support recursion, however. Where iteration is simple repetition, recursion is a method of simplifying a problem by restating it in terms of itself, each step defined with simpler conditions until you reach the most easily solved statement of the original problem.
There are those who can readily understand the intricacies of recursion. And then there are the rest of us who must rely on fingers, toes, and a good supply of pencils and scratch-paper. Probably the most classic example of recursion is the famous problem of "The Towers of Hanoi."
127
According to legend, at the Creation, God placed a brass plate within the Temple of Behanares under the tower which was supposedly the center of the world. On this brass plate were three diamond needles, one of which had a stack of 64 golden disks, each disk smaller than the one beneath it. The Braham monk assigned to the temple was to transfer the disks from one needle to another without ever having a larger disk placed on top of a smaller disk.
If the monks of old had a computer available with Logo, the problem could have been solved quite easily. However, to actually move the disks - one per second - would have required 58 thousand billion years. The first disk requires one move to place it on another needle. The second disk requires two moves. The third requires four, the fourth requires eight, and so forth until you reach the 64th disk. That makes for a grand total of 18,446,744,073,709,55,615.
The Towers of Hanoi is a program readily available for different computers and in dif­ferent languages. In the appendix, you'll find a version of the game written in Apple Logo, should you want to enter the program to demonstrate the recursive principles used. For those who do not wish to enter this long procedure line-by-line, the YPLA Software Ex­change has this procedure available in Apple Logo and also in TI LOGO.
128
r
CHAPTER 7 CONDITIONALS
r i
r
The recursive procedures we have done so far would keep going until the Turtle runs out of ink or until we stop him. To give us more control, we can add a conditional state­ment to the procedure, a command to limit the number of times the procedure calls itself.
Remember the Over-LJnder game? If has a conditional in it to stop the game. If the first person gets back to his or her original place, then the game stops.
mm
J.                                    &A
r
Have the students make a list of conditional (if-then) statements. If it's raining, then .... If the light turns red, then .... If I'm hungry, then ... (If they think of 20, then they can stop.)
r
We can do something similar with the recursive procedures we have written. Look back at the ERECTORSET procedure. Suppose we want to limit the number of times the Turtle will repeat the triangle inside the square. We'll add another variable and a conditional state­ment to the procedure. "T" stands for times, as in the number of times to repeat the pro­cedure. The conditional statement will be IF :T = 0 STOP. (It's not necessary to include —                    "then.")
TI and MIT
r r r
TO ERECTORSET :N :T
IF :T = 0 STOP
SQUARE :N
TRIANGLE :N
FD :N
ERECTORSET :N :T-1
END
129
APPLE
TOERECTORSET :N :T
IF :T = 0 [STOP]
SQUARE :N
TRIANGLE :N
FD :N
ERECTORSET :N :T-1
END
Now when we give the command ERECTORSET, we give not only an input for the size of the design but also for the number of times it should be repeated. For example, ERECTOR­SET 15 10 will repeat the triangle inside the square 10 times. Every time the Turtle gets down to the recursive line, he goes back to the beginning, subtracts 1 from :T, and con­tinues the procedure. He reads the conditional line, and if :T = 0, he stops. If :T doesn't equal 0, then he goes on to the next line.
Look at the recursive procedures we defined earlier and at the ones you came up with, and figure out how to add conditional statements to them.
How about the spiral? Can you think of a way to get the Turtle to stop spiraling at a certain point? There are several different possibilities. Here's one for the square spiral.
TIand MIT
TO SPIRAL :N IF :N > 150 STOP FD :N RT :90
SPIRAL :N + 5 END
APPLE
TO SPIRAL :N
IF :N > 150 [STOP]
FD :N
RT :90
SPIRAL :N + 5
END
Here's another way to add a conditional statement to a spiral:
TO SPIRAL :N :A
IF :A < 0 STOP
FD :N
RT :A
SPIRAL :N :A - 1
END
130
-
You've probably noticed that the only difference in writing conditionals in the various versions of Logo is that APPLE requires brackets around STOP, while TI and MIT do not. The rest of the examples in this chapter are shown without the brackets. Remember to add them for APPLE Logo.
What if you want to make several spirals on the screen? Here you have to be careful. The following program was written by a fifth-grade student who wanted to make two spirals within the same program.
r
r r r
r
TO SPIRAL :N
IF :N >
30 STOP
FD :N
RT 90
SPIRAL
:N + 2
FD50
IF :N >
30 STOP
FD :N
RT 90
SPIRAL
:N + 2
END
It seemed perfectly logical to her that the first part of the program would make one spiral, then the Turtle would move FD 50 and continue on to the second spiral. What she did not realize is that the Turtle always returns to the beginning of the program. What a mess! Try it and find out.
This student was forgetting one of the most important rules when writing programs in LOGO: Think in "chunks." The spiral is one "chunk" of the program and the FD 50 is another "chunk." When there is more than one "chunk," a new procedure is needed that can include both "chunks." Try this one:
TO SPIRAL :N IF :N > 30 STOP
FD :N
r
r
r r
RT 90
SPIRAL
END
:N + 2
TO SPIRALS :N SPIRAL :N FD :N SPIRAL :N END
131
Or maybe this one:
TO SPIRALS :N REPEAT 4[SPIRAL END
:N FD 50]
Simple spirals can be made much more complex. Before teaching the Turtle, try some of these fancier things with a straightedge.
Straightedge Curves
Start with a 6-inch straightedge in a vertical position on a sheet of paper. Remember that the pencil point operates like the Turtle. Draw a line from the bottom of the straightedge to the top and back again to about lA inch from the bottom. Rotate the straightedge to the left about 10 degrees. Repeat the procedure. This time the forward distance should be shortened by lA inch. Continue forward, back, and left until the final line is only about '/2 inch long. Does your design look like the one below?
The Turtle made this design using the following procedure and values of D = 50 and A = 10. (D stands for distance; A stands for angle.)
TO FAN.LEFT :D :A
IF :D < 0 STOP
FD :D
BK :D-5
LT :A
FAN.LEFT :D-3 :A
END
132
What will happen if the angle increases each time a line is drawn? Try this procedure and find out.
TO LETSFINDOUT :D :A
IF :D < 0 STOP
FD :D
BK :D-5
LT :A
LETSFINDOUT :D-3 :A + 1
END
Can you figure out how to get this design? (Hint: Look at the angle between the lines. Is it increasing or decreasing?)
Look at this design. It's the result of a combination of FAN.LEFT and FAN.RIGHT.
TO SWIRL :D :A START1
FAN.LEFT :D :A START1
FAN.RIGHT :D :A START2
FAN.LEFT :D :A
TO START1 SETXY 0 0 SETH 0 END
TO START2 SETXY 0 0 SETH 0 END
START2
FAN.RIGHT :D :A END
TI              TO START1
SXY 0 20 SH 0 END
TO START2 SXY 0 20 SH 180 END
APPLE TO START1
SETPOS [0 0] SETH 0 END
TO START2
SETPOS [0 0] SETH 180
END
133
If you want to really get elaborate, try adding a START3 and a START4 to position the Turtle to face 90 and 270 and then repeat FAN.LEFT and FAN.RIGHT. Here are some examples using various inputs:
Let's try a curve of a different sort. In the diagram below, the circle has been divided into 36 parts. A line has been drawn with a straightedge from A to B. The straightedge is then rotated to CD, EF, etc. As the straightedge moves around the circle, the top end travels slower than the bottom. All of the lines that have been drawn are straight lines, but a curve appears.
Try this activity yourself on the accompanying worksheet. Rotate the straightedge to the right first until the design resembles the one below. Then try rotating it to the left. What shape do you get?
134
It's difficult to teach the Turtle to draw this exact design. However, it s not too hard to do one that is similar. Think about the movements of your pencil along the straightedge. Then look at the design again. Can you see where the following procedure comes from?
TO HALFHEART :N IF :N < 0 STOP FD 90 BK :N RT 25 BK 60
HALFHEART :N-3 END
Try HALFHEART 29 for starters. Then experiment with different inputs. Which do you like best?
Get your straightedge out again and let's try something else. See if you can duplicate the figure below. Can you describe the drawing well enough to teach the Turtle?
This is the procedure that drew the above figure:
TORCURVE :A :D
IF :A > 90 STOP
FD 10
RT :A
FD :D
BK :D
LT :A
RCURVE :A + 10 :D
END
Try RCURVE 10 70 and then experiment with various other inputs.
Write a procedure for LCURVE. Then combine RCURVE and LCURVE to make an arrow:
ARROW :A :D
(TI)
SXY(-30)(-40)
(APPLE)
SETPOS [-30 -40]
(MIT)
SETXY -30-40
RCURVE :A :D
RT 180
LCURVE :A :D
END
The illustration was drawn by giving the command ARROW 10 60. Try other inputs as well.
135
If you enjoy playing around with the curves we've been doing, you might want to try your hand at string art. Look at how this figure is drawn.
You simply connect A to A, B to B, etc. Now try to finish the design on the worksheet. Could you teach the Turtle to do something similar?
136
CURVES FROM STRAIGHT LINES
r r r r
r
r
r r
137
1
-
1
1
1
1
-
CURVES FROM STRAIGHT LINES
1
1
1 1
1
CHAPTER 8 TESSELATIONS!
Once you feel very comfortable with conditionals and recursion, try your hand at design­ing wallpaper, linoleum, and quilts, otherwise known as tesselations.
Tesselations are mosaics built by repeating the same geometric shape or combination of shapes over and over again. The tesselation below is a combination of large and small squares. Using square cut-outs, have the students reproduce this tesselation.
Make a different tesselation using the same squares.
Have the students study this tesselation. Ask them to identify two basic geometric shapes in it. See if they can find a star. How about an hourglass?
This tesselation is even more complex. Ask the students to describe the three basic shapes. Can it be made from only two of those shapes? Try it.
141
Have the students design tesselations of their own. Start with one shape, then two, then three. This can be done with graph paper or through the manipulation of differently shaped cut-outs or playtiles. If done pn graph paper, the designs can then be colored and the process of coloring can be another exercise in repeating patterns (and can change the entire emphasis of the original design.)
It is possible to teach the Turtle to tesselate. We'll take it one step at a time so you can watch it evolve. We'll call it . . .
-
-
-
The Evolution of a Tesselation!
Back to the original square! (Did you ever realize how versatile squares can be?) First, let's write a procedure to draw a tower of squares, each one smaller than the one under it.
TI and MIT
TO SQUARES :S
IF :S< OSTOP
REPEAT 4[FD :S RT 90]
FD :S
SQUARES :S-5
END
APPLE
TO SQUARES :S
IF :S < 0 [STOP]
REPEAT 4[FD :S RT 90]
FD :S
SQUARES :S-5
END
Try SQUARES with various inputs and see what happens.
In order to have the Turtle draw SQUARES several times, let's define a new procedure called TOWER. TOWER will have two inputs, one to determine the size of the first square and the second to tell the Turtle how many times to repeat SQUARES.
1
i 1
i
i
TI and MIT
TO TOWER :S :T IF :T = 0 STOP SQUARES :S TOWER :S :T - 1 END
APPLE
TO TOWER :S :T IF :T = 0 [STOP] SQUARES :S TOWER :S :T - 1 END
El
E E
ft
142
Sometimes something will happen to LOGO that makes you want to try something differ­ent from your original goal. For example, if you tried TOWER 15 5, you might wonder if you could make a square picture frame out of the repeating shapes. Let's try!
TO FRAME
PU LT 90 FD 100 RT 90 BK 40 PD
REPEAT 4 [TOWER 15 4 RT 90]
END
EPCPCFOCEg
ETTrnrnrnHq
Now back to the tesselation. . . .
Let's stick with Tower 15 4 and see what would happen if, when the Turtle gets to the top, he turns around, moves over a little, and comes back. We need a procedure to tell him how to turn around:
TO MOVE1
RT 90 FD 30 RT 90
END
When the Turtle gets to the bottom, the move will be slightly different:
TO MOVE2
RT 90 FD 15 BK 15 RT 90
END
Now let's put TOWERs and MOVEs together to cover the screen:
TI and MIT
TO COVER :X IF :X = 0 STOP
TOWER
MOVE1
TOWER
MOVE2
COVER
END
15 4
15 4
:X -1
APPLE
TO COVER :X IF :X = 0 [STOP] TOWER 15 4 MOVE1
TOWER 15 4 MOVE2 COVER :X -1 END
143
In order to get the Turtle to start in the lefthand corner and cover the screen, we'll define one more procedure:
APPLE and MIT
TO GETGOING
PU LT 90 FD 130 RT 90 BK 50 PD
COVER 8
END
TI
TO GETGOING
PU LT 90 FD 100 RT 90 BK 30 PD
COVER 5
END
TI For those of you working with TI, you'll find that the Turtle sometimes runs out of ink. It is your challenge to experiment with procedures to see how far you can go before you get the out-of-ink message. We edited COVER to include the command TOWER 14 3 rather than TOWER 15 4. This made it necessary to change the forward command in MOVE1 to FD 28 rather than 30 and to change the forward command in MOVE2 to 14 rather than 15. You might find some other ways to edit the procedures.
p
p.
5
5
5
5
rf
s
%
\
K
s
K
lr
E
y
h
pi
i
5
5
"'l
k
h'
It
lr
\
e
"t
»r
lr
H
h
*i
5
b
*]
5
*i
"i
\
%
\
e
lr
U
d
d
h
a
3
\
5
i
fij
■h
K
E
V
"r
"t
itj
d
5
3
*i
"i
S
5
i
i
P
E
J=
Jr
L:
k
id
H
J
Once you've designed a couple tesselations, you might like to try your hand at optical illusions. A word of warning: They require persistence, logical thinking, problem solving skills, and a good sense of direction - the Turtle's, not yours!
As with the tesselation, the optical illusion we chose to experiment with contains one geometric shape repeated over and over. The tricky thing about the illusion is how the shape changes its position. Just when you think you have discovered a pattern, it shifts. But, unless you can discover a pattern and define it, writing a program on the computer can become a lengthy and frustrating experience.
This is a good assignment for older youngsters who have had quite a bit of experience with LOGO. It challenges their problem-solving ability and encourages them to break a problem down into simpler pieces in order to solve it. And this is difficult enough that suc­cessfully designing one promotes a real sense of accomplishment.
While there is no one correct way to teach the Turtle to draw this illusion, we'll take you step by step through one approach. You may discover other solutions or other patterns that could be defined.
144
n
//E7//a7//Z7/
r
r
r
r
r
This design is three nested diamonds repeated and turned in several directions. Thus, the first step is to define a diamond with a variable:
TO DIAMOND N
REPEAT 2 [FD :N RT 60 FD :N RT 120]
END
Then put three together:
r
r
APPLE                TO DIAMONDS
DIAMOND 8
PU RT 60 BK 8 LT 60 BK 8 PD DIAMOND 24
PU RT 60 BK 8 LT 60 BK 8 PD DIAMOND 40 END
TI                         TO DIAMONDS
DIAMOND 6
PU RT 60 BK 3 LT 60 BK 3 PD DIAMOND 12
PU RT 60 BK 3 LT 60 BK 3 PD DIAMOND 18 END
Play around with putting diamonds together to form the outer rim.
You might notice the pattern of three nested diamonds side by side. To draw them, we defined SIDE3.
145
\^g^
APPLE
TO SIDE3
DIAMONDS
PU FD 56 RT 60 FD 16 LT 60 PD
DIAMONDS
PU FD 56 RT 60 FD L6 LT 60 PD
DIAMONDS
END
TI
TO SIDE3
DIAMONDS
PU FD 24 RT 60 FD 6 LT 60 PD
DIAMONDS
PU FD 24 RT 60 FD 6 LT 60 PD
DIAMONDS
END
Is it possible to reposition the Turtle and repeat SIDE3 six times for the six sides of the outer rim? Look carefully.
We defined the outer RIM using SIDE3, ADD2 which repositioned the Turtle and added two more nested diamonds, and MOVEl which repositioned the Turtle to draw SIDE3 again.
APPLE
TO START
PU BK 103 LT 60 FD 16 PD
END
146
TO ADD2
PU FD 16 RT 60 FD 56 LT 60 PD
DIAMONDS
PU FD 16 RT 60 FD 56 LT 60 PD
DIAMONDS
END
TO MOVE1
PU FD 24 RT 60 FD 40 RT 60 FD 16 PD
END
TO RIM
START
SIDE3
ADD2
MOVE1
SIDE3
ADD2
MOVE1
SIDE3
ADD2
END
TO ADD2
PU FD 6 RT 60 FD 24 LT 60 PD
DIAMONDS
PU FD 6 RT 60 FD 24 LT 60 PD
DIAMONDS
END
TO MOVE1
PU FD 12 RT 60 FD 18 RT 60 FD 6 PD
END
TO RIM
SIDE3
ADD2
MOVE1
SIDE3
ADD2
MOVE1
SIDE3
ADD2
END
147
Once the outer rim is defined, the INSIDERIM is not difficult. It is similar to the outer rim, but has one less nested diamond on each side.
ALL                      TO INSIDERIM
MOVE2 SIDE2 ADD1 MOVE1 SIDE2 ADD1 MOVE1 SIDE2 ADD1 END
APPLE                TO MOVE2
PU RT 60 BK 24 RT 60 FD 16 LT 60 PD END
TO SIDE2
DIAMONDS
PU FD 56 RT 60 FD 16 LT 60 PD
DIAMONDS
END
TO ADD1
PU FD 16 RT 60 FD 56 LT 60 ^D
DIAMONDS
END
TI                         TO MOVE2
PU RT 60 BK 12 RT 60 FD 6 LT 60 PD END
TO SIDE2
DIAMONDS
PU FD 24 RT 60 FD 6 LT 60 PD
DIAMONDS
END
TO ADD1
PU FD 6 RT 60 FD 24 LT 60 PD
DIAMONDS
END
148
Next comes the inside BLOCK, three DIAMONDS put together:
APPLE
TO BLOCK
PU RT 60 FD 16 RT 60 FD 16 LT 60 PD
DIAMONDS
PU FD 24 RT 60 FD 40 RT 60 FD 16 PD
DIAMONDS
PU FD 24 RT 60 FD 40 RT 60 FD 16 PD
DIAMONDS
END
TI
TO BLOCK
PU RT 60 FD 6 RT 60 FD 6 LT 60 PD
DIAMONDS
PU FD 9 RT 60 FD 18 RT 60 FD 6 PD
DIAMONDS
PU FD 9 RT 60 FD 18 RT 60 FD 6 PD
DIAMONDS
END
Then define a procedure to draw the whole PATTERN:
TO PATTERN
RIM
INSIDERIM
BLOCK
END
U*5--^
Paper Diamonds
This optical illusion was designed out of 27 nested diamonds. It may be helpful to have the youngsters cut out 27 paper diamonds and move them around in various pat­terns. Use a pencil as the Turtle and trace the pattern, keep­ing careful track of every turn. By having them try the pat­tern with single diamonds rather than nested diamonds, they will not have to worry about penup and pendown commands for the first attempt.
149
NOTES
-
-
"
1
1
150
CHAPTER 9 DESIGNING WITH COLOR
In addition to drawing with a black pen on a blue-green background (TI) or a white pen on a black background (APPLE), the Turtle can draw with several other colors, and you can change the color of the background, also.
Here's a list of all the colors:
TI
0 CLEAR
1  BLACK
2 GREEN
3  LIME
4  BLUE
5  SKY
6  RED
7  CYAN
8  RUST
9  ORANGE
10 YELLOW
11  LEMON
12  OLIVE
13  PURPLE
14  GRAY
15  WHITE
APPLE
0 BLACK
1  WHITE
2  GREEN
3 VIOLET
4 ORANGE
5  BLUE
First try changing the background:
TI
APPLE MIT
Type COLORBACKGROUND and the number of the color you want. The short form is CB.
Type SETBG and the number of the color you want.
Type BG and the number of the color you want.
After the students experiment with changing the background color, challenge them to write a procedure that will cycle through several of the colors. The colors will change very quickly if we don't add some kind of command to make the computer wait for awhile before changing to the next color. TI and APPLE both have a WAIT command already in the language. We'll define one for MIT. Since we're using WAIT 50, it's kind of like telling the computer to count to 50 before it reads the next command.
151
TI                         TO RAINBOW
CB13 WAIT 50 CB6 WAIT 50 CB9 WAIT 50 CB10 WAIT 50 CB2 WAIT 50 CB4
RAINBOW END
APPLE                TO RAINBOW
SETBG 3 WAIT 50 SETBG 4 WAIT 50 SETBG 2 WAIT 50 SETBG 5 WAIT 50 SETBG 1 WAIT 50 RAINBOW END
MIT There are many ways we can write a procedure to make time pass before the next command is carried out. Here's one way:
TO WAIT :T
REPEAT :T[REPEAT 4[RT 90]]
END
This procedure will make the Turtle spin in a circle, but he's going to do it in four 90-degree turns, and he'll do it however many times (T) we tell him to. Pay careful attention to the double brackets.
MIT                     TO RAINBOW
BG3 WAIT 25 BG4 WAIT 25 BG2 WAIT 25 BG5 WAIT 25 BG1 WAIT 25 RAINBOW END
152
Since the students are typing the same things over and over with only the number of the color changing, would it be possible to define a procedure using a changing variable like we did with the spiral? Challenge them to try. Their first efforts might look like this:
TI                         TO RAINBOW :C
(for color)
CB:C WAIT 50
RAINBOW :C + 1 END
APPLE                TO RAINBOW :C
SETBG :C WAIT 50
RAINBOW :C + 1 END
MIT                     TO RAINBOW :C
BG:C WAIT 25 RAINBOW :C + 1 END
Since there's no color 16 on the TI and no color 6 on the APPLE, we'll have to add a command to make the computer start over if it gets to 6 or 16. We need a conditional command.
TI                         IF :C > 15 MAKE "C :C - 15
MIT                     IF :C > 5 MAKE "C :C - 5
APPLE                IF :C > 5 [MAKE "C :C - 5]
English translation: IF the value of C (color) is greater than 15 (5), THEN make the value of C that value minus 15 (5).
Every time the computer "sees" an IF-THEN command, it tests the first part of the com­mand and IF it is true, it carries out the second part of the command. With the APPLE, for example, IF C = 6, then the computer carries out the last part of the command by sub­tracting 5 to make the new value 1. It then goes on to the next command. IF the first part of the command is false (if C = 1,2, 3, 4, or 5), it ignores the last part of that command and goes on to the next command.
Here's how the procedures look with the IF-THEN command included:
TI                         TO RAINBOW :C
IF :C > 15 MAKE "C :C - 15
CB :C
WAIT 50
RAINBOW :C + 1
END
153
APPLE
TO RAINBOW :C IF :C > 5 [MAKE "C SETBG :C WAIT 50
RAINBOW :C + 1 RAINBOW :C + 1 END
:C - 5]
MIT
TO RAINBOW :C IF :C > 5 MAKE "C BG :C WAIT 50
RAINBOW :C + 1 END
:C - 5
Now let's experiment with pencolors! To change the pencolor, type
TI                         SETCOLOR (or SC) and the number of the color.
APPLE                SETPC and the number of the color.
MIT                     PC and the number of the color.
Some pencolors look better on certain background colors. Experiment with different com* binations and decide which you like best.
Now let's design a picture and add color to it. Using all the shapes and commands you have learned, create a picture or design. Break the design down into segments and work on one at a time.
For example, if you were going to draw Frosty the Snowman, you might have one pro­cedure called BODY, another called HEAD, and another called HAT. (You'll have to define them yourself this time!) The procedure for FROSTY would then be written like this:
TO FROSTY BODY HEAD HAT
154
That's a good start. Now how about adding ARMS and SCARF.
TO FROSTY
BODY
HEAD
HAT
SCARF
ARMS
END
How about designing a pine tree and adding a forest to the picture? Remember the house in Chapter 3? We could add a few details to it and add it to our snow scene. Maybe we could even add a few snowflakes and .... Are you beginning to get the idea?!
Now let's add color to Frosty's winter snow scene.
TI
APPLE
MIT
TO FROSTY
TO FROSTY
TO FROSTY
CB 4
SETBG
5
BG 5
SC 15
SETPC
1
PC 1
BODY
BODY
BODY
HEAD
HEAD
HEAD
SC 1
SETPC
0
PC 0
HAT
HAT
HAT
SC 6
SETPC
3
PC 3
SCARF
SCARF
SCARF
SC 1
SETPC
0
PC 0
ARMS
ARMS
ARMS
SC 2
SETPC
2
PC 2
PINETREES
PINETREES
PINETREES
Another way to add color would be to add color commands within each procedure. Then, for example, you could have the Turtle draw the HEAD with a white outline, change the pencolor, and draw black eyes and mouth.
155
Filling With Color
Suppose you want to fill Frosty's hat with color?
Have the students draw a square on a sheet of paper. As they color it in, have them describe what they are doing. Do they go back and forth with the crayon? We could have the Turtle do the same thing. Have them figure out how to tell the Turtle to go back and forth within a square until he has colored it in. Try it and write down all the commands you use. How would you use a REPEAT command to fill the square?
For a square with a side of 20, the procedure might look like this:
TO FILL.SQUARE
REPEAT 4[FD 20 RT 90]
REPEAT 10[FD 20 RT 90 FD 1 RT 90 FD 20 LT 90
FD 1 LT 90] END
How would you write a procedure to fill any size square you draw? Using the procedure you just wrote, write a procedure with a variable in it.
As with most problems in LOGO (and in life!), there is more than one solution to filling a square. We could have the Turtle draw successively smaller squares until the entire square is filled in. Using recursion and a conditional, we can write a procedure to fill any size square we want:
TIand MIT
TO FILL.SQ :N IF :N = 0 STOP REPEAT 4[FD :N RT 90] FILL.SQ :N - 1 END
APPLE
TO FILL.SQ :N IF :N = 0 [STOP] REPEAT 4[FD :N RT 90] FILL.SQ :N - 1 END
How would you write a fill command for a triangle? A circle? A hexagon?
156
r               WORKSHEET ON FILLING
                Write procedures to FILL a square and a triangle:
TO FILL.SQUARE                   TO FILL.TRI
I
r i
r
Use your procedures to teach the Turtle how to draw the following designs. Write down the commands you use.
r r
i
r
Make up a design of your own and teach it to the Turtle. Write down the commands you use.
157
-
L
-
i
i
I
Random
Sometimes it's fun to add color randomly - let the Turtle choose the colors! A RAN­DOM command will enable you to do that. Remember the tesselation we did in Chapter 8? Let's call it back up and randomly add color to it. First define a color procedure:
TI
TO COLOR
SC 1 + RANDOM
END
APPLE
TO COLOR
SETPC 1 + RANDOM 4
END
MIT
TO COLOR
PC 1 + RANDOM 4
END
Including the 1 + in the command prevents the computer from randomly selecting 0 which is clear on the TI and black on the APPLE and makes your beautiful quilt look moth-eaten!
APPLE and MIT RANDOM 4 tells the computer to select any number between 0 and 4. Since we have also told the computer to add 1 to the random number, the result will be a number between 1 and 5.
TI RANDOM on the TI tells the computer to select any number between 0 and 9. Since we have also told the computer to add 1 to the random number, the result will be a number between 1 and 10.
Once you have defined the COLOR procedure, add it to the SQUARES procedure:
TIand MIT
TO SQUARES :S
IF :S < 0 STOP
COLOR
REPEAT 4[FD :S RT 90]
FD :S
SQUARES :S-5
END
APPLE
TO SQUARES :S
IF :S < 0 [STOP]
COLOR
REPEAT 4[FD :S RT 90]
FD :S
SQUARES :S-5
END
The rest of the procedures for the tesselation will remain the same.
159
NOTES
-
-
1 j
i
160
T ~I
1 -I "
COLORS
ON
SET BACKGROUND SET PENCOLOR
BLACK
WHITE
GREEN
VIOLET
ORANGE
BLUE
APPLE
MIT
-
Li
-
COLORS
COLORBACKGROUND SETCOLOR
CLEAR
BLACK
GREEN
LIME
BLUE
SKY
RED
CYAN
RUST
ORANGE
YELLOW
LEMON
OLIVE
PURPLE
GRAY
WHITE
"
1j
-
1
1
1
jl
-
-
-
-
-r r r
CHAPTER 10 TURTLE POSITIONS
Heading
In addition to telling the Turtle to turn right or left, there is another way to tell hirn to face a certain direction. Remember the clock concept. If the Turtle is facing 12 o'clock, he is facing 0. If he turns toward 1 o'clock, he is facing 30, 2 o'clock is 60, 3 o'clock is 90, etc. If we want him to point a certain direction, we can tell him to SET his HEADING to that direction:
TI APPLE
SH
SETH
Have the students try various inputs to the heading command. What happens if they give the command SH or SETH 360? What about SH or SETH -30? Experiment with the heading commands. There are times they will be much easier to use than a RT or LT turn.
For a handy guide to setting the Turtle's heading, add the heading numbers to your Tur­tle clock.
X and Y Coordinates
In the various designs and pictures we have taught the Turtle to draw, we have moved him to various starting positions with the FD, BK, RT, and LT commands. Sometimes that can be quite tedious and it seems that there should be an easier way to tell him to start in the lower lefthand corner or upperright or wherever. You guessed it again - there is!
Have the students place the Turtle at HOME facing toward the top of the screen. HOME is 0 and every step he goes FORWARD toward the top of the screen is a positive step. Exactly how many steps can he go before he slips off the top of the screen and wraps around to the bottom? Return the Turtle to HOME and this time go BACKWARD toward the bot­tom of the screen. Every BK step should be thought of as a negative step. (In fact, one way to tell the Turtle to go BK 10 is to tell him to go FD -10.) How far can he go?
r
r r
165
Once they figure out the up and down dimensions of the screen, there is a quick way to tell the Turtle exactly where to go above or below the midline. Use
TI
SY followed by a space and a number.
APPLE
SETY followed by a space and a number.
The number will be positive for those positions above the middle and negative for those positions below the middle. Try several and watch him hop from place to place. On the APPLE, use the PENUP command first or the Turtle will draw from one position to the next.
TI
APPLE
PU
SY57
SETY 57
SY -100
SETY -100
SY23
SETY 23
SY -72
SETY -72
That takes care of up and down. What about side to side?
Return the Turtle to HOME and rotate him RIGHT 90. He should be facing the right side of the screen. Figure out how many steps he can go forward before he wraps. Return him to HOME, rotate him RT 90 (or SET his HEADING 90), and this time go BACKWARD toward the left edge of the screen.
<■
-£>
+
The positions to the right of HOME are positive and those to the left are negative. To tell the Turtle to go to the left or right, use
TI APPLE
SX followed by a space and a number SETX followed by a space and a number
Try several commands using both positive and negative numbers and watch the Turtle jump back and forth across the screen.
166
TI
APPLE
PU
SX91
SETX 91
SX -35
SETX -35
SX77
SETX 77
SX -85
SETX -85
By using an X command and a Y command, we can place the Turtle anywhere on the screen. Allow a lot of exploration time for children to hop the Turtle all over the screen, especially if this is the first time the children have worked with coordinates. They are working with negative and positive numbers, and up and down and side to side movements, and all that can be quite confusing.
Dot-to-Dots Using Coordinates
What child hasn't enjoyed connecting dots to discover a picture. Well, this time they will first have to plot the dots on graph paper using X and Y coordinates. Two different grids are included in this book, the larger one for smaller hands and the smaller one for older children. We will include the directions for plotting a couple of designs; then it's up to you. Find a simple drawing and transfer it to a copy of the grid paper. Figure out the coordinates for the outline and list them on a separate sheet of paper. The children must then take the list, plot all the points, and connect them in the order they were listed. Older children might enjoy plotting their own pictures and exchanging with each other.
Remember to point out that the first number is always the X coordinate and the second number is always the Y coordinate. Keep the designs simple for younger children. Start with simple designs and move up to more complex ones with older children.
Sailboat
5, -10 -40, -10 5,40 35, -10 5, -15 -30, -15 -20, -25 20, -25 30, -15 5, -15
167
tfc^ZXYUa
Elephant
1
2
3
5,25
-5, -5
-30, 15
25,25
-5, -15
-30, 25
30,20
-15, -15
-20, 35
35,25
-10, -5
-15,35
35, 15
-15,5
-10,30
30,0
-20,0
-5,25
35, -10
-25, -10
-5,30
30, -15
-30, -15
0,30
25, -5
-35, -15
5,25
25, -15
-40, -10
5, 10
15, -15
-40, -5
-5,5
15, -5
-35, -10
-10,5
5, -5
-30, -10
-10, 10
10, -15
-25,0
-15,5
0, -15
-25, 10
Just as we combined the X and Y coordinates in the dot-to-dot activities, with the first number for X and the second for Y, it is possible to combine the two in one command for the Turtle. However, since the up-and-down and side-to-side movements of the Turtle can not be seen as readily when the commands are combined, younger students will probably work better with two separate commands. To combine the commands, use
TI SXY and two numbers, the first for X and the second for Y. If Y is a negative number, it will have to be enclosed in parentheses.
MIT SETXY and two numbers, the first for X and the second for Y. If Y is a negative number, it will have to be enclosed in parentheses.
APPLE SETPOS [_
_]. The two numbers for X and Y are enclosed in brackets.
Try a few commands:
TI
SXY 10 10 SXY 25 (-72) SXY -17 (-80) SXY -62 37
MIT
SETXY 10 10 SETXY 25 (-72) SETXY -17 (-80) SETXY -62 37
APPLE
SETPOS [10 10] SETPOS [25 -72] SETPOS [-17 -80] SETPOS [-62 37]
168
APPLE Remember earlier you learned that you will have to pick the pen up before you give the X and Y commands to the Turtle? Does that suggest another way to draw? How about keeping the pen down and trying to draw a picture by telling the Turtle what coor­dinates to go to? It's like drawing a dot-to-dot on the computer! Try it with the sailboat or the elephant or make up your own design.
Let's combine several of the concepts we have learned and have the Turtle draw some "graph paper" on the screen. Then we can hop him around on the graph paper by giving him X and Y commands. We'll have to use recursion and a conditional to draw the graph.
APPLE
TOXLINES :X
IF :X > 100 [STOP]
PUSETX :X
SETHO
SETY -60
PD FD 160
XLINES :X +10
END
TOYLINES :Y IF :Y > 100 [STOP] PU SETY :Y SETH 90 SETX -100 PD FD 200 YLINES :Y + 10 END
1—J
TO GRAPH XLINES -100 YLINES -60 END
MIT The MIT version is like the APPLE version. Just remove the brackets from the conditional commands in XLINES and YLINES.
169
TI                       TOXLINES :X
IF :X > 60 STOP
SX :X
SHO
SY -40
FD 120                                                                                                           4|
XLINES :X + 20
END
-
TO YLINES :Y
IF :Y > 80 STOP
SY :Y
SH90
SX -60
FD120
YLINES :Y + 20
END
TO GRAPH XLINES -60 YLINES -40 END
~
170
X AND Y COORDINATES
Using the graph below, pretend you are the Turtle and draw each of the four squares. Remember if the Turtle starts at HOME and you send him to a new position, he is still facing the top of the screen. That should help you figure out how to start drawing the squares.
1.) Go to X = 15 and Y = 20. REPEAT 4[FD 3 RT 90]
2.) GOtoX = -5 and Y = 13. REPEAT 4[FD 7 RT 90]
3.) Go to X =10 and Y = -10. REPEAT 4[FD 5 RT 90]
4.) GotoX = -7 and Y = -7 REPEAT 4[FD 4 RT 90]
Y
X
171
-
-
-
-r r r r r
MORE FUN WITH X AND Y
Can you figure out the X and Y positions of the dots in this graph?
Il
1.) X = Y =
2.) X = Y =
3.)
X = Y
4.) X:
Y
r
r
Now go to the computer and write down the commands you use to make the Turtle:
1.)     Put a square in the upper left-hand corner.
2.)     Put a triangle in the upper right-hand corner.
3.)     Put a circle in the bottom left-hand corner.
4.)     Draw a house in the bottom right-hand corner.
r r r r r
173
-
d|Lj
-
--
-
-
^
r
l^Ff
^3j^ -*'^
i
r
r
—•
-
-
fT
I
1
■1
"
175
-
_
~
-
-
-
,
-
Ill Mill MM MM II 111 II 111 IIV^^V
«Kw ]>)
1 II 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 II ilPvTt^Ss. ,''^'jt
1 1 1 1 1 1 1 1 1 1 1 1 1 Mil 1 M1 vHn^ Z^€t
—J —I. .J 1 llj r^tf ^*ii^^p"ff J [ I
ill
111! 111111111111111111111 MM
177
--
mm
WORKSHEET ON SHAPES
Here are some shape-pictures, some simple, some not so simple. Try to figure out how they were made and write down the commands you would use to have the Turtle draw them. A good way to help you figure out Turtle commands is to design your shape-picture on graph paper. Once you have designed it, try tracing over it without ever picking up your pencil. If you do have to pick up your pencil, remember that would be a PENUP (TI, APPLE) or SC 0 (MIT) command for the Turtle.
7 Vi^iA
a
r.:i
-
i )
..•• fl
T7T7
•»*'".
•i;,r
•;v
JSNSI^NSlSIsr
f
"*p*
ou
DO
1
B51
do!
i a i::i I
OD OD
pal
r.i p I
OD
j ^
del Bdi
DO
OR
f::i t::i 1 ! a a
mil
am aoj
i;r.i ei m m
ffl EF.I
i:i;i eb
133 133 133 133
179
L
1
n
-
r r r r
r r r
r r r r r r r
l
r r
r r
CHAPTER 11 FUN WITH WORDS
Turtle Graphics is a fascinating feature of Logo. It takes you from single keystroke exer­cises for preschoolers through college-level solid and spherical geometry exercises, studies of Newtonian physics, dynamics, as well as Einstein's general theory of relativity.
But graphics is only part of the fun of Logo. It also has some wonderful list and text pro­cessing capabilities which open opportunities for word games, language programs, word processing, data base management, and a wide range of other applications. It's fun to com­bine list processing with turtle graphics to make the language even more interactive.
It is not our intent to cover these capabilities in great detail, but we can't leave this Sourcebook without at least whetting your appetite a bit. So take your time. Explore these exercises slowly, one step at a time. Keep your reference guide handy. If, after reading this chapter, your stomach is growling and you feel totally frustrated, be assured that we are working on a similiar step-by-step approach to teaching - and learning - list processing. In the meantime. . .
Let's start with a simple interactive program which will seem like the computer is carry­ing on an intelligent conversation with you. This is fun for students to program and try on someone who is not familiar with computers. Their friends don't need to know that all the questions and responses are pre-programmed. It's also fun for students to try them out on each other.
AMP TH£A/.../"
Commands
PRINT: The print command tells the computer to print on the screen whatever is inside the square brackets. For example, if you type PRINT [I AM A COMPUTER] and press RETURN, the computer will print I AM A COMPUTER. Try the PRINT command with a few different inputs.
Sometimes you want a blank line on the screen, perhaps between one question and response and the next question. In that case, type PRINT [ ] and press return.
SENTENCE: This command tells the computer to put lists or words together. If you type PRINT SENTENCE [TURTLES ARE FUN, ] [RABBITS ARE HARE-Y], the com­puter will put those two lists together and print TURTLES ARE FUN, RABBITS ARE HARE-Y. When you want to put more than two elements in a SENTENCE, use parentheses like this: PRINT (SENTENCE [TURTLES ARE FUN,] [RABBITS ARE HARE-Y,] [BUT I LIKE THEM BOTH.])
181
Now let's put the SENTENCE and PRINT commands together to make the computer carry on an "intelligent conversation." First, we'll write a procedure that makes the ques­tion WHAT IS YOUR NAME? appear on the screen. Then it will combine an input with a preprogrammed response, in this case, I DON'T BELIEVE WE'VE MET, Name.
TI                         TO TALK
PRINT [WHAT'S YOUR NAME?]
PRINT SENTENCE [I DON'T BELIEVE WE'VE MET, ] READLINE
END
READLINE is used to make the procedure wait for you to type an answer to a question and press RETURN.
APPLE                TO TALK
PRINT [WHAT'S YOUR NAME?]
PRINT SENTENCE [I DON'T BELIEVE WE'VE MET, ] READLIST
END
READLIST is used to make the procedure wait for you to type an answer to a question and press RETURN.
MIT                     TO TALK
PRINT [WHAT'S YOUR NAME?]
PRINT SENTENCE [I DON'T BELIEVE WE'VE MET, ] REQUEST
END
REQUEST is used to make the procedure wait for you to type an answer to a question and press RETURN.
Have your students think up some other short procedures that will ask a question and then combine the answer with a response they make up. For now, do not use yes-no ques­tions. We'll get to them in a minute. A few ideas to get them started:
What's your favorite color? Who's your best friend? What's your favorite sport? What kind of music do you like?
182
r r r r r r r r r r
It is possible to set up a conditional in a listing program just like we did earlier in Turtle Graphics. IF you write a procedure that asks a yes-no question, THEN you will have to set up a conditional. Since there are two possible answers, you'll want two possible responses for the computer to make. In this case, we'll ask, "Have you ever talked to a computer before?"
TI                         TO TALK
PRINT [ HAVE YOU EVER TALKED]
PRINT [TO A COMPUTER BEFORE?]
TEST READLINE = [NO]
IFT PRINT [OH BOY! A BEGINNER!]
IFF PRINT [DON'T WORRY, I WON'T TELL ANYONE.]
APPLE                TO TALK
PRINT [HAVE YOU EVER TALKED]
PRINT [TO A COMPUTER BEFORE?]
TEST READLIST = [NO]
IFT [PRINT [OH BOY! A BEGINNER!]]
IFF [PRINT [DON'T WORRY, I WON'T TELL ANYONE.]]
MIT                     TO TALK
PRINT [HAVE YOU EVER TALKED]
PRINT [TO A COMPUTER BEFORE?]
TEST REQUEST = [NO]
IFT PRINT [OH BOY! A BEGINNER!]
IFF PRINT [DON'T WORRY, I WON'T TELL ANYONE.]
To set up a conditional, we use a TEST command, and IFTRUE (IFT) and IFFALSE (IFF) commands. IF it is TRUE that the user answers no, the computer will respond with, "Oh boy! A beginner." IF it is FALSE that the user answers no (in other words, says yes), the computer will print, "Don't worry, I won't tell anyone. Notice how the double brackets are used in APPLE LOGO.
Have the students write a conversational procedure using all the listing commands they have learned so far. Have them try them out on each other.
Suppose you want to set up a procedure with a variety of choices. We'll combine some Turtle graphics and listing for this one, and write a procedure that allows students to choose a big, medium, or small circle. So first we need to ask which size circle they want to see:
r-
r r i
r
TO CIRCLE
PRINT [DO YOU WANT A BIG, MEDIUM, OR SMALL CIRCLE?]
Now we need to set up a conditional that will allow for three different choices: If the answer is BIG, the Turtle must draw a big circle; if the answer is medium, a medium circle; and if the answer is small, a small circle. (This is an excellent time to remind your students to break the problem down into smaller pieces. Rather than combining everything in one pro* cedure, write sub-procedures for BIGCIRCLE, MEDIUMCIRCLE, and SMALLCIRCLE.)
TO BIGCIRCLE REPEAT 360 [FD 1 RT 1] END
183
TO MEDIUMCIRCLE REPEAT 180 [FD 1 RT 2] END
TO SMALLCIRCLE REPEAT 90 [FD 1 RT 4] END
READWORD: This command is already defined in the STARTUP procedures in Ap­ple LOGO. We define it similarly in TI and MIT:
TI                         TO READWORD
OUTPUT FIRST READLINE END
MIT                     TO READWORD
OUTPUT FIRST REQUEST END
Now we can add to the CIRCLE procedure.
TO CIRCLE
PRINT [DO YOU WANT A BIG, MEDIUM, OR SMALL CIRCLE]
MAKE "ANSWER READWORD
IF :ANSWER = "BIG [BIGCIRCLE]
IF rANSWER = "MEDIUM [MEDIUMCIRCLE]
IF :ANSWER = "SMALL [SMALLCIRCLE]
END
MAKE: This command requires two entries. You want to MAKE one entry into another. In essence, you want to MAKE a variable take on the value of the second entry, or second input. For example, MAKE "ANSWER READWORD means that ANSWER should take on the value of the entry made at READWORD.
You say you've got this one kid who's going to try to outfox the computer and type in GIGANTIC - there's at least one in every class! You can do one of two things. You can add lines to try to match any of the answers that smart kid will come up with. For example:
IF :ANSWER = "GIGANTIC [BIGCIRCLE] IF :ANSWER ="HUMONGOUS [BIGCIRCLE] IF :ANSWER = "SO-SO [MEDIUMCIRCLE] IF :ANSWER = "TEENCY [SMALLCIRCLE]
We could be here all day thinking up possible responses. But why not just add another line to cover all of them. If the answer doesn't match any of the choices, the computer will go down to the next line and respond, I CAN'T DO THAT!
184
TO CIRCLE
PRINT [DO YOU WANT A BIG, MEDIUM, OR SMALL CIRCLE?]
MAKE "ANSWER READWORD
IF :ANSWER = "BIG [BIGCIRCLE]
IF rANSWER = "MEDIUM [MEDIUMCIRCLE]
IF rANSWER = "SMALL [SMALLCIRCLE]
PRINT [I CAN'T DO THAT!]
CIRCLE
END
Being able to write a procedure to have the computer ask for a response and then draw a circle according to the choice made suggests the possibility of writing a procedure to have the Turtle draw any geometric shape the user wants. Since this is a conversational pro­gram, begin by asking the user if she or he wants to see some shapes.
APPLE                TO SHAPES
VANISH
PRINT [WANT TO SEE SOME SHAPES?] TEST FIRST READWORD = "Y
IFT [PRINT [ ] PRINT [WHAT SHAPE DO YOU WANT TO SEE?]]
IFF [PRINT [ ] PRINT [OK,BYE FOR NOW!] STOP] PICK END
MIT and TI
TO SHAPES
VANISH
PRINT [WANT TO SEE SOME SHAPES?]
TEST FIRST READWORD = "Y
IFT PRINT [WHAT SHAPE DO YOU WANT TO SEE?]
IFF PRINT [OK. BYE FOR NOW!] STOP
PICK
END
VANISH is an all-purpose type of procedure written here to clear the screen at appropriate times during the procedure.
APPLE
TO VANISH
&MIT
CLEARTEXT
TEXTSCREEN
END
TI
TO VANISH
CLEARSCREEN
NOTURTLE
END
185
Test First Headword = "Y
Sometimes when you look at LOGO commands, they seem to make no sense at all. But look again. You know what TEST means - you want to TEST to see if something is TRUE or FALSE. READWORD means to read the word entered in response to a question.
Now! What would TEST FIRST READWORD = "Y mean?
If you said, TEST the FIRST element of the entered response to see if it begins with "Y," give yourself a Gold Star. You're absolutely right. When FIRST is included in a command, it means to look at the First element of a word or list. In this case it means TEST the FIRST element of the entered response to see if it begins with "Y." The entered response could be YES, YEAH, or just Y. The action to follow would be the same.
Not to confuse the issue of our procedure; but now that you have an idea of what FIRST does, consider what would happen if the same line read, TEST LAST READWORD = "S. What would that mean?
If you said it means TEST the LAST element of the entered response to see if it is an "S," you deserve another Gold Star. The procedures tests the response to see if you entered YES or some other word ending in S.
Obviously, for this procedure, FIRST is the more appropriate command in that it suits a broader range of possible responses to the question. However, there are occasions when you want to test the last element of a word or a list. Why not try a few experiments to see how it can work?
PICK is a procedure defined to tell the Turtle what shape to draw.
APPLE                TO PICK
MAKE "S READWORD
IF :S = "CIRCLE [CIRCLE]
IF :S = "RECTANGLE [RECTANGLE]
PRINT [ ]
PRINT [I DON'T KNOW HOW TO DO THAT!]
PRINT [WILL YOU TEACH ME HOW?]
TEST FIRST READWORD = "Y
IFT [TEACH :S]
IFF [SHAPES]
END
MIT and TI
TO PICK
MAKE "S READWORD
IF :S = "CIRCLE CIRCLE STOP
IF :S = "RECTANGLE RECTANGLE STOP
PRINT [ ]
PRINT [I DON'T KNOW HOW TO DO THAT?]
186
PRINT [WILL YOU TEACH ME HOW?] TEST FIRST READWORD = "Y IFT TEACH :S IFF SHAPES END
TEACH was defined to get the user to respond with the number of sides the particular shape has and how long to make each side.
APPLE                TO TEACH :S
VANISH
PRINT (SENTENCE [HOW MANY SIDES DOES A] :S [HAVE?]) MAKE "R READWORD PRINT [ ]
PRINT [HOW LONG SHOULD ONE SIDE BE?] MAKE "D READWORD PRINT [ ]
PRINT [LET ME SEE IF I CAN DRAW ONE NOW.] WAIT 80 POLY :R :D END
TI                        TO TEACH :S
VANISH
PRINT (SENTENCE [HOW MANY SIDES DOES A] :S [HAVE?]) MAKE :R READWORD PRINT [ ]
PRINT [HOW LONG SHOULD ONE SIDE BE?] MAKE "D READWORD
PRINT [LET ME SEE IF I CAN DRAW ONE NOW.] WAIT 180 POLY :R :D END
MIT As we discussed in the color chapter, there is no WAIT command in MIT LOGO and we must define one:
TO WAIT :T
HT
REPEAT :T [REPEAT 4 [RT 90]]
ST
END
TO TEACH :S
VANISH
PRINT (SENTENCE [HOW MANY SIDES DOES A "] :S ["
HAVE?])
MAKE "R READWORD
PRINT [ ]
PRINT [HOW LONG SHOULD ONE SIDE BE?]
187
MAKE "D READWORD
PRINT [ ]
PRINT [LET ME SEE IF I CAN DRAW ONE NOW.]
WAIT 10
POLY :R :D
END
Using the Rule of 360, we can define a polygon procedure:
TO POLY :R :D
REPEAT :R [FD :D RT 360 / :R]
END
But what about a rectangle? Another procedure will have to be defined in case someone wants to see a rectangle.
TO RECTANGLE
PRINT [HOW LONG SHOULD THE LONG SIDE BE?]
PRINT [ ]
MAKE "LONGSIDE READWORD
PRINT [HOW LONG SHOULD THE SHORT SIDE BE?]
MAKE "SHORTSIDE READWORD
CS (on the APPLE) or TELLTURTLE (on the TI)
REPEAT 2 [FD :SHORTSIDE RT 90 FD :LONGSIDE RT 90]
END
To make the whole program repetitive and more conversational go back to POLY, REC­TANGLE, SMALLCIRCLE, MEDIUMCIRCLE, and BIGCIRCLE, and add VANISH as the first command for Apple and MIT, and TELLTURTLE for TI. The last three commands in each of these procedures should be:
APPLE and TI
PRINT [HOW'S THAT?]
WAIT 180
SHAPES
END
MIT                     PRINT [HOW'S THAT?]
WAIT 20 SHAPES END
Change the last command in the CIRCLE program from CIRCLE to SHAPES. Now SHAPES will keep repeating until the user doesn't want to see anymore squares, triangles, octagons, decagons, circles, etc., etc., etc.
188
r
r
r r r r r r
Here is a listing of the entire SHAPES program in each of the three versions:
TI LOGO
TO POLY :R :D
TELL TURTLE
REPEAT :R [FD :D RT 360 / :R]
PRINT [HOW'S THAT?]
WAIT 180
SHAPES
END
TO VANISH CLEARSCREEN NOTURTLE END
TO TEACH :S
VANISH
PRINT (SENTENCE [HOW MANY SIDES DOES A] :S [HAVE?])
MAKE "R READWORD
PRINT [ ]
PRINT [HOW LONG SHOULD ONE SIDE BE?]
MAKE "D READWORD
PRINT [LET ME SEE IF I CAN DRAW ONE NOW.]
WAIT 180
POLY :R :D
END
TO RECTANGLE
TELL TURTLE
PRINT [HOW LONG SHOULD THE LONG SIDE BE?]
PRINT [ ]
MAKE "LONGSIDE READWORD
PRINT [HOW LONG SHOULD THE SHORT SIDE BE?]
MAKE "SHORTSIDE READWORD
TELL TURTLE
REPEAT 2 [FD :SHORTSIDE RT 90 FD :LONGSIDE RT 90]
PRINT [HOW'S THAT?]
WAIT 180
SHAPES
END
TO PICK
MAKE "S READWORD
IF :S = "CIRCLE CIRCLE STOP
IF :S = "RECTANGLE RECTANGLE STOP
PRINT [ ]
PRINT [I DON'T KNOW HOW TO DO THAT!]
PRINT [WILL YOU TEACH ME HOW?]
TEST FIRST READWORD = "Y
r
r r r r
189
IFT TEACH :S IFF SHAPES END
TO MEDIUMCIRCLE
TELL TURTLE
REPEAT 180 [FD 1 RT 2]
PRINT [HOW'S THAT?]
WAIT 180
SHAPES
END
TO READWORD OUTPUT FIRST READLINE END
TO CIRCLE
PRINT [DO YOU WANT A BIG, MEDIUM, OR SMALL CIRCLE?]
MAKE "ANSWER READWORD
IF :ANSWER = "BIG BIGCIRCLE
IF :ANSWER = "MEDIUM MEDIUMCIRCLE
IF :ANSWER = "SMALL SMALLCIRCLE
PRINT [CAN'T DO THAT!]
CIRCLE
END
TO SMALLCIRCLE
TELL TURTLE
REPEAT 90 [FD 1 RT 4]
PRINT [HOW'S THAT?]
WAIT 180
SHAPES
END
TO SHAPES
VANISH
PRINT [WANT TO SEE SOME SHAPES?]
TEST FIRST READWORD - "Y
IFT PRINT [WHAT SHAPE DO YOU WANT TO SEE?]
IFF PRINT [OK. BYE FOR NOW!]
PICK
END
TO BIGCIRCLE
TELL TURTLE
REPEAT 360 [FD 1 RT 1]
PRINT [HOW'S THAT?]
WAIT 180
SHAPES
END
190
APPLE LOGO
TO CIRCLE CS
PRINT [DO
MAKE "ANS
IF :ANS =
IF :ANS =
IF :ANS =
PRINT [I
SHAPES1
END
YOU WANT A BIG, MEDIUM, OR SMALL] PRINT [CIRCLE?] READWORD "BIG [BIGCIRCLE] "MEDIUM [MEDIUMCIRCLE] "SMALL [LITTLECIRCLE] CAN'T DO THAT!]
r
r r r r r r r r r r
TO RECTANGLE
VANISH
PRINT [HOW LONG SHOULD THE LONG SIDE BE?]
PRINT []
MAKE "LSIDE RW
PRINT [HOW LONG SHOULD THE SHORT SIDE BE?]
MAKE "SSIDE RW
CS
REPEAT 2 [FD rSSIDE RT 90 FD :LSIDE RT 90]
PRINT [HOW'S THAT?]
WAIT 180
SHAPES1
END
TO TEACH :S VANISH
(TYPE [HOW MANY SIDES DOES A] "\ :S " ) PRINT [HAVE?] MAKE "R RW PRINT []
PRINT [HOW LONG SHOULD ONE SIDE BE?] MAKE "D RW PRINT []
PRINT [LET ME SEE IF I CAN DRAW ONE NOW.] WAIT 8 0 POLY :R :D END
TO BIGCIRCLE
VANISH
REPEAT 360 [FD 1 RT
PRINT [HOW'S THAT?]
WAIT 180
SHAPES1
END
TO MEDIUMCIRCLE
VANISH
REPEAT 180 [FD 1 RT
PRINT [HOW'S THAT?]
WAIT 180
SHAPES1
END
1]
2]
191
TO LITTLECIRCLE
VANISH
REPEAT 120 [FD 1 RT 3]
PRINT [HOW'S THAT?]
WAIT 180
SHAPES1
END
TO CIRCLE1
VANISH
END
TO POLY :R :D
VANISH
CS
REPEAT :R [FD :D RT 360 / :R]
PRINT [HOW'S THAT?]
WAIT 180
SHAPES1
END
TO PICK
MAKE "S READWORD
IF :S = "CIRCLE [CIRCLE STOP]
IF :S = "RECTANGLE [RECTANGLE STOP]
PRINT []
PRINT [I DON'T KNOW HOW TO DO THAT!]
PRINT [WILL YOU TEACH ME HOW?]
TEST FIRST READWORD = "Y
IFTRUE [TEACH :S STOP]
IFFALSE [SHAPES STOP]
END
TO VANISH CLEARTEXT TEXTSCREEN END
TO SHAPES1
VANISH
REPARSE
PRINT [WANT TO SEE SOME MORE SHAPES?]
TEST FIRST READWORD = "Y
IFTRUE [PRINT [] PRINT [WHAT SHAPE DO YOU WANT TO SEE?]]
IFFALSE [PRINT [] PRINT [OK. BYE FOR NOW!] STOP]
PICK
END
TO SHAPES
VANISH
REPARSE
PRINT [WANT TO SEE SOME SHAPES?]
TEST FIRST READWORD = "Y
IFTRUE [PRINT [] PRINT [WHAT SHAPE DO YOU WANT TO SEE?]]
IFFALSE [PRINT [] PRINT [OK. BYE FOR NOW!] STOP]
PICK
END
192
-
MIT LOGO
TO PICK
I
r
MAKE
IF :S IF :S PRINT PRINT PRINT TEST
READWORD = "CIRCLE CIRCLE STOP = "RECTANGLE RECTANGLE STOP
[]
[I DON'T KNOW HOW TO DO THAT.] [WILL YOU TEACH ME HOW.] FIRST READWORD = "Y
IFTRUE TEACH :S IFFALSE SHAPES END
TO CIRCLE
VANISH DRAW
PRINT [DO YOU
WANT A BIG,
MEDIUM,]
r r r r r
PRINT [OR
MAKE "ANS
IF :ANS =
IF :ANS =
IF :ANS =
PRINT [I
SMALL CIRCLE?] READWORD "BIG BIGCIRCLE "MEDIUM MEDIUMCIRCLE "SMALL SMALLCIRCLE CAN'T DO THAT.]
SHAPES END
TO RECTANGLE
VANISH
PRINT [HOW LONG SHOULD
MAKE "LSIDE READWORD
PRINT []
PRINT [HOW LONG SHOULD
MAKE "SSIDE READWORD
VANISH DRAW
REPEAT 2 [FD :SSIDE RT
PRINT [HOW'S THAT?]
WAIT 20
SHAPES END
TO READWORD
OUTPUT FIRST REQUEST END
THE LONG SIDE BE?]
THE SHORT SIDE BE?]
90 FD :LSIDE RT 90]
r r r
r
r
TO TEACH :S
VANISH
PRINT ( SENTENCE [HOW MANY SIDES DOES A !
MAKE "R READWORD
PRINT []
PRINT [HOW LONG SHOULD ONE SIDE BE?]
MAKE "D READWORD
PRINT []
PRINT [LET ME SEE IF I CAN DRAW ONE NOW.]
WAIT 10
POLY :R :D END
] :S [HAVE?] )
193
TO POLY :R :D
VANISH DRAW
REPEAT :R [FD :D RT 360/:R]
PRINT [HOW'S THAT?]
WAIT 20
SHAPES END
TO BIGCIRCLE
VANISH DRAW
REPEAT 120 [FD 1 RT 1]
PRINT [HOW!S THAT?]
WAIT 20
SHAPES END
TO MEDIUMCIRCLE
VANISH DRAW
REPEAT 180 [FD 1 RT 2]
PRINT [HOW!S THAT?]
WAIT 20
SHAPES END
TO WAIT :T
HT
REPEAT :T [REPEAT 4 [RT 90]] END
TO VANISH
CLEARTEXT
TEXTSCREEN END
TO SMALLCIRCLE
VANISH DRAW
REPEAT 120 [FD 1 RT 3]
PRINT [HOWfS THAT?]
WAIT 20
SHAPES END
TO SHAPES
VANISH
PRINT [WANT TO SEE SOME SHAPES?]
TEST FIRST READWORD = "Y
IFTRUE PRINT [WHAT SHAPE DO YOU WANT TO SEE?]
IFFALSE PRINT [OK, BYE FOR NOW.] STOP
PICK END
194
That's All For Now, Folks!
If you have come this far, you know we're not going to end this Sourcebook like that. Obviously, it is going to be done in a procedure.
BUTFIRST let's look at a few more commands.
r
BUTFIRST: This command will output all but the first element of a list or word. It stands to reason then that BUTLAST will output all but the last element.
r
FPUT and LPUT: With all of your experience now, you have probably guessed the mean­ing of these commands: FirstPUT and LastPUT. Literally, each means to combine two elements and put them in either sequential or reverse order. The first element can be a word but the second must be a list.
r r r r r r
r
In Apple Logo, you can trick the computer into believing that a list is a word by using CONTROL-Q followed by a space between each word. (On the screen and in the following listings, the CONTROL-Q appears as a backwards slashmark.) In this way, the computer sees a list as a single element. Take a look.
APPLE                TO ENDING
MAKE "X "THATS/ ALL/ FOR MAKE "Y FPUT :X [NOW, FOLKS!] PRINT :Y END
The result of this procedure would be, THAT'S ALL FOR NOW, FOLKS! printed on the screen. To accomplish the same thing in MIT or TI Logo, the first element must be a word, followed by a list.
TI & MIT            TO ENDING
MAKE "X "THAT'S
MAKE "Y FPUT :X [ALL FOR NOW, FOLKS!]
PRINT :Y
END
Now that we have combined two elements, let's use them in another procedure rather than merely print them on the screen. To do this, change LINE 3 to read OUTPUT :Y. OUTPUT transfers the result of one procedure to another procedure which is calling that particular result. For example:
TO WORDTRI :Y
PRINT :Y
PRINT BUTFIRST :Y
END
On the screen, you'll see two lines printed.
APPLE                THAT'S ALL FOR
NOW, FOLKS!
195
MIT & TI            THAT'S
ALL FOR NOW, FOLKS!
That's really not very impressive. The computer has worked with only two elements. First it printed both together as "Y." Then it printed all BUT the FIRST element. To make a more impressive picture, let's change the procedure a bit.
APPLE                TO WORDTRIANGLE :WORDS
IF :WORDS = " [STOP]
PRINT :WORDS
WORDTRIANGLE BUTFIRST :WORDS
END
MIT                     TO WORDTRIANGLE :WORDS
IF :WORDS = " STOP PRINT :WORDS
WORDTRIANGLE BUTFIRST :WORDS END
TI LOGO will not recognize an empty space. This error will reportedly be corrected in TI LOGO II. To run the procedure in TI LOGO, modify the second line to read: IF :WORDS = "!.
MIT and TI LOGO will both accept the apostrophe as a "single quote." This allows you to define a combination of letters and spaces to form what the computer will read as one word. The entry is:
WORDTRIANGLE " ' THATS ALL FOR NOW, FOLKS!"
There should be an apostrophe before the "S" in THATS. However, if it was included, the computer would read the apostrophe as the end of the word.
In APPLE LOGO, the entry is:
WORDTRIANGLE "THATS/ ALL/ FOR/ NOW,/ FOLKS!"
The backward slash mark represents CONTROL-Q followed by a space.
196
THAT'S ALL FOR NOW, FOLKS! HAT'S ALL FOR NOW, FOLKS! AT'S ALL FOR NOW, FOLKS! T'S ALL FOR NOW, FOLKS! 'S ALL FOR NOW, FOLKS! S ALL FOR NOW, FOLKS!
ALL FOR NOW, FOLKS! ALL FOR NOW, FOLKS! LL FOR NOW, FOLKS! L FOR NOW, FOLKS!
FOR NOW, FOLKS! FOR NOW, FOLKS! OR NOW, FOLKS! R NOW, FOLKS!
NOW, FOLKS! NOW, FOLKS! OW, FOLKS! W, FOLKS! , FOLKS!
FOLKS! FOLKS! OLKS! LKS! KS!
S!
i
Now let's try that same procedure with BUTLAST, and this time we mean it!
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'S
THAT'
THAT
THA
TH
T
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
ALL
AL
A
FOR NOW, FOLKS!
FOR NOW, FOLKS
FOR NOW, FOLK
FOR NOW, FOL
FOR NOW, FO
FOR NOW, F
FOR NOW,
FOR NOW,
FOR NOW
FOR NO
FOR N
FOR
FOR
FO
F
197
NOTES
1
1
198
Appendix A Editing Features
APPLE
CTRLB CTRLF
Moves cursor back one space without changing procedure.
Moves cursor forward one space.
Moves cursor forward one space.
Erases the character or space one space to the left of the cursor. If the cursor is at beginning of text line, moves entire line to end of previous line.
Moves cursor down to next line
Moves cursor up to previous line
Moves cursor to beginning of current line
Moves cursor to end of current line.
Deletes character directly behind cursor.
Defines procedure as is, leaves edit mode.
Aborts editing, leaves edit mode.
"Kill" or clear all to the right of the cursor.
CTRLN CTRLP CTRL A CTRLE CTRLD CTRLC CTRLG CTRLK
199
MIT
CTRLN CTRLP CTRL A CTRLE CTRLD CTRLK CTRLO CTRLC CTRLG ESC
Moves cursor back one space. Moves cursor forward one space. Moves cursor down to next line. Moves cursor up to previous line. Moves cursor to beginning of current line. Moves cursor to end of current line. Deletes character directly under cursor. Deletes (kills) a line from cursor to end. Opens a space to insert a new line. Defines procedure as is, leaves edit mode. Aborts editing, leaves edit mode. Erase character to left of the cursor.
200
TI 99/4
SHIFT W SHIFT V SHIFT t SHIFT \ SHIFT — SHIFT —* ENTER
SHIFT T
SHIFT F SHIFT C
Moves cursor to beginning of line
Moves cursor to end of line
Moves cursor up one line
Moves cursor down one line
Moves cursor one space to left
Moves cursor one space to right
If cursor is at the end of a line, opens a space for a new line. Other­wise moves the cursor, the character immediately above it and everything to the right down to the next line.
Erases the character or space one space to the left of the cursor. If the cursor is under the first character of a line, moves line up one line.
Erases the character or space immediately above the cursor. If the cursor is at the end of a line, moves next line up.
Erases the character or space above the cursor and everything to its right.
SHIFT Z
Leaves the Edit Mode
201
TI 99/4A
FNCT5 FNCT6 FNCT J FNCT J FNCT^-FNCT—-ENTER
FNCT3
FNCT 1 FNCT4
Moves cursor to beginning of line
Moves cursor to end of line
Moves cursor up one line
Moves cursor down one line
Moves cursor one space to left
Moves cursor one space to right
If cursor is at the end of a line, opens a space for a new line. Other­wise moves the cursor, the character immediately above it and everything to the right down to the next line.
Erases the character or space one space to the left of the cursor. If the cursor is under the first character of a line, moves line up one line.
Erases the character or space immediately above the cursor. If the cursor is at the end of a line, moves next line up.
Erases the character or space above the cursor and everything to its right.
FNCT 9
Leaves the Edit Mode.
202
r
r r r r r
Appendix B A Logo Reference and Resource Guide
"This has been really great. Now where can I go to find more information about Logo?"
This list of articles and books will provide a basic source list for information on Logo and Turtle graphics. In that so many articles and books are being written, it is impossible to keep this list complete and up-to-date. Indeed, many of these sources will undoubtedly refer you to other sources of information.
There are also a innumerable courses and workshops available, many of which are ac­tively advertised in educational and personal computing magazines. There are also numerous companies offering teaching and curriculum aids for Logo. Should you want any informa­tion on the courses or other information, contact the Young Peoples' LOGO Association, 1208 Hillsdale Drive, Richardson, TX 75081.
BYTE Magazine, September 1980, "New Cultures from New Technologies," Seymour Papert. Write: BYTE, P.O. Box 397, Hancock, NH 03449.
Creative Computing, March 1981, "Computers and Compurter Cultures," Seymour Papert. 39 East Hanover Avenue, Morris Plains, NJ 07950.
Oncomputing, Summer 1981, "Seymour Papert: Spearheading the Computer Revolu­tion," and "Learning with LOGO." P.O. Box 397, Hancock, NH 03449.
BYTE Magazine, June 1981, "LOGO for Personal Computers." This presents an excellent comparison betwwen TI LOGO and MIT LOGO. Write BYTE, P.O. Box 397, Hancock, NH 03449.
Electronic Education, September 1981, "Society will balk, but the future may demand a computer for each child," Seymour Papert. Electronic Communications, Inc. Suite 220, 1311 Executive Center Drive, Tallahassee, FL 32301.
Kilobaud Microcomputing, September 1981. The issue is devoted to, "Learning with Computers. Are the Schools Ready for the Challenge?" This is one of the best series of articles we have seen. It includes descriptions of work done by MIT using LOGO to aid the disabled. Write to 80 Pine Street, Peterborough, New Hampshire 03458.
Personal Computing, December 1981, "Progressive Learning by Computer." A very good description of TI LOGO. 50 Essex Street, Rochelle Park, NJ 07662.
Creative Computing, December 1981, "TI LOGO," an evaluation of the language, and "Seymour Papert and the LOGO Universe." Write Creative Computing, 39 West Hanover Ave., Morris Plains, NJ 07950.
For a description of "Pilot's Turtle Graphics for Atari," write to Recreational Com­puting, 1263 El Camino Real, Box E, Menlo Park, CA 94025. This was published in the May-June 1981 issue.
Turtle News and TLComputing, published monthly by YPLA. Includes articles, pro­cedures on- and off-computer activities. Contact YPLA, P.O. Box 855067, Richardson, TX 75085.
203
r r r
r
99'er Magazine regularly carries articles on LOGO. The first three issues have carried varied articles by Henry Gorman of Austin College, Sherman, TX. Write to: 99'er Magazine, P.O. Box 5537, Eugene, Oregon 97405.
Interface Age, December 1981. Articles describe user friendly languages including Atari Pilot with Turtle Graphics, and TI LOGO. Write to 16704 Marquardt Avenue, Cerritos, CA 90701.
The Computing Teacher,Volume 8 No.5, LOGO: A Computer Environment for Learn­ing Disabled Students. By Sylvia Weir and Daniel Watt. Contact The Computing Teacher, Dept. of Computing & Information Science, University of Oregon, Eugene, OR 97403.
Microcomputing, March 1982, "Logo, Not Just For Kids/9 by Harold Nelson. Write Microcomputing, Pine Street, Peterborough, NH 03458.
Sof talk, "LOGO, The Voice of the Turtle," by Jim Muller. Also, "The New Shell Game" by Roe Adams. July 1982. Donna Bearden and Jim Muller have written numerous articles for Softalk. For more information contact Softalk, 11021 Magnolia Blvd., North Hollywood, CA 91601.
Compute Magazine carries a regular column by David Thornburg entitled "Friends of the Turtle," which describes Logo and other Turtle Graphics languages. Write Compute, P.O. Box 5406, Greensboro, N.C. 27403.
For more information on the organization, Friends of the Turtle, write: P.O. Box 1317, Los Altos, CA 94022.
Popular Mechanics, September 1982, a special feature article on Logo and personal computers. Write to 257 West 57th Street, New York, NY 10023.
Creative Computing, October 1982, "The Friendly Languages," by Jim Muller. Write to the magazine at 39 West Hanover, Morris Plains, NJ 07950.
The Computing Teacher, November, 1982. This special issue was devoted to Logo. Dr. Kathleen Martin of the University of Dallas and the YPLA publishes a regular column on Logo in The Computing Teacher.
The Computing Teacher, February 1983. A special issue on computers in special educa­tion. Includes an article by Jim Muller on the use of Logo by the handicapped.
Turtle Geometry, by Harold Abelson and Andrea diSessa, 1981, MIT PRESS. This is an excellent book that explores many of the possibilities of turtle graphics, from basic shapes to the theory of relativity.
Logo and the Apple II, Apple Logo. These are two books published by BYTE publica­tions that describe the various versions of LOGO. Contact BYTE Publications, 70 Main Street, Peterborough, NH 03458
Atari Pilot for Beginners, by Jim Conley and Tracy Deliman. Reston Publishing Com­pany, Reston, VA 22090. One of the - if not THE - best introductions to Atari Pilot on the market. Required reading for Pilot users.
204
r
r r r r r r r r r r r r r
Picture This, by David Thornburg, 1982, Addison-Wesley. This is one of several excellent books by Dr. Thornburg on turtle graphics on the Atari computer.
Picture This II, by David Thornburg and published by Addison-Wesley, describes the Turtle Graphics features of Apple Superpilot.
Learning With Logo, by Daniel Watt, BYTE Publications, 70 Main Street, Peterborough, NH.
1,2,3, My Computer and Me, A Logo Funbook for Kids, by Donna Bearden, YPLA. Contact Reston Publishing Company, 11480 Sunset Hills Road, Reston, VA 22090, or the YPLA.
Logo Educational Computing Journal. A new journal published by Krell Software Corporation, 1320 Stony Brook Road, Stony Brook, NY 11790.
The National Logo Exchange. A monthly newsletter for teachers and parents publish­ed by Posy Publications, P.O. Box 5341, Charlottesville, VA 22905.
Logophile is a periodical published by the College of Education, Mac Arthur Hall, Queen's University, Kingston, Ontario K71 3N6. Contact Dr. William Higginson.
Follk, Friends of LISP/Logo & Kids, is a non-profit educational and scientific cor­poration formed by a group at San Francisco State University. Write to 436 Arballo Drive, San Francisco, CA 94132.
Poly spiral, The Boston Logo User's Group Newsletter, is published by the Boston Com­puter Society, Three Center Plaza, Boston, MA 02108.
For more information on the MIT Logo Memos listed below contact the Mit Logo Group, 545 Technology Square, Cambridge, MA 02139.
Abelson and diSessa, "Student Science Training Program in Mathematics, Physics, and Computer Science.,, Artificial Intelligence Memo #393. Logo Memo #29, MIT 1976.
Feurzig, Papert, Bloom, Grant, and Solomon, "Programming Languages as a Conceptual Framework for Teaching Mathematics.'* Report #1889, Bolt, Beranek and Newman, Cam­bridge, MA 1969.
Papert, "Teaching Children to be Mathematicians vs. Teaching About Mathematics.'* Ar­tificial Intelligence Laboratory Memo #249, Logo Memo #4, Mit 1971.
Papert, "Uses of Technology to Enhance Education," Artificial Intelligence Memo #298, Logo Memo #8, MIT 1973.
Papert, Abelson, diSessa, Watt, "Assessment and Documentation of a Children's Com­puter Laboratory." AI Memo #460, Logo Memo #48, MIT, 1977.
Papert, diSessa, Watt, Weir, "Final Report of the Brookline LOGO Project, Parts I, II, and III." AI Memos #545 and #546, LOGO Memos #53 and #54, MIT 1979.
205
Papert and Solomon, "Twenty Things to do with a Computer/' AI Memo #248, LOGO Memo #3, MIT, 1971.
Papert and Weir, "Information Prosthetics for the Handicapped.9* AI Memo #496, Logo Memo #51, MIT 1978.
Weir, "The Use of LOGO for the Diagnosis of Children's Abilities in Areas of Spatial Reason­ing, and the use of LOGO for Remediation." Internal working paper, MIT Logo Group, 1979.
Weir, "Evaluation of Cultivation of Spatial and Linguistic Abilities in Individuals with Cerebral Palsy." AI Memo #570, Logo Memo #51, MIT, March 1980.
Weir and Emmanuel, "Using Logo to Catalyse Communication in an Autistic Child." Depart­ment of Artificial Intelligence Memo #15, University of Edinburgh, Scotland, 1976.
The Computer, Logo, and the Disabled
The following is a partial list of sources for information on the use of computers and com­puter technology to aid the handicapped. As with the sources for information on Logo, each of these may well prove to be a source of additional information.
Closing the Gap: This is a newspaper dedicated to serving the handicapped community with information on the use of microcomputers for the physically and mentally disabled. Contact them at Route 2, Box 39, Henderson, MN 56044.
Handicapped Education Exchange, 11523 Charlton Drive, Silver Spring, Maryland 20902. For access to the HEX System, call (301) 593-7033. To call Richard Barth of HEX, call (301) 681-7372.
National Paraplegia Foundation, 3400 Hulen, Fort Worth, TX 76107. Jack Kishpaugh and the NPF have developed an excellent, low-cost program for adapting the TI99/4 Home Computer to the needs of the physically handicapped. Jack's "shade tree" adaptations allow a handicapped person to operate the computer with only a mouthstick - console, monitor, cassette recorder, disk system, and modem.
The Trace Research and Development Center for the Severely Com­municatively Handicapped, University of Wisconsin, Madison, is organizing an In­ternational Software Registry of programs for handicapped individuals. Contact George C. Vanderheiden, Director, Trace Center, 314 Waisman Center, 1500 Highland Avenue, Madison, Wisconsin 53706 (608) 262-6966.
For more information on the Johns Hopkins University competition to develop ap­plications of the personal computer for the handicapped, contact: Paul L. Hazan, The Johns Hopkins University, Applied Physics Laboratory, Johns Hopkins Road, Laurel, MD 20810.
A report on the Johns Hopkins program has been published by the IEEE Computer Socie­ty. It describes the top 100 entries in the competition. Write to IEEE Computer Society, P.O. Box 80452, Worldway Postal Center, Los Angeles, CA 90080. Ask for Publication #392.
206
r r r r r r r
r r
r r r r r r
From the Computer Using Educators newsletter comes the following resource: Robert Kawka of Kolb Junior High School, 2351 N. Spruce Street, Rialto, California 92376, who has developed a bibliography of material related to computers in special education. For a copy, send a stamped - 2 stamps required - self-addressed envelope to Mr. Kawka.
Apple Computer Inc. publishes a Resource Guide on applications of the personal com­puter to aid the handicapped. Write Resource Guide, Marketing Service Department, Ap­ple Computer, Inc., 10260 Bandley Drive, Cupertino, CA 95014.
The EIES - Electronic Information System - is an information exchange on aids to the disabled. Write EIES, New Jersey Institute of Technology, Newark, NJ 07102.
Type-'N-Talk (TM) from Votrax, 500 Stephenson Highway, Troy, MI 48084, is a speech synthesizer that can be used by any computer with an RS232 interface. Through the use of a built-in phonetic text-to-speech algorithm, it offers a virtually unlimited vocabulary. Suggested Retail: $375.00.
Terminal Emulator II, Texas Instruments, P.O. Box 53, Lubbock, TX 79408. TE II in­cludes text-to-speech capabilities that include changes in pitch and inflection for more natural sounding speech. The Solid State Software (TM) command module also includes terminal emulation software for verbal communication via modem.
Contact HC Electronics, Inc., P.O. Box 2741, Laguna Hills, CA 92653, for additional information on "Handi-Voice," a synthetic speech aid.
Voice Input Module, an extremely accurate and adaptable voice input system for the Apple Computer. Voice Machine Communications Inc., 10522 Covington Circle, Villa Park, CA 92667.
Shadow-Vet is a unique voice entry terminal for the Apple II that is well-suited for the handicapped. Contact Scott Instruments, 1111 Willow Springs Drive, Denton, TX 76201.
The Voice Box for Atari and Apple II computers is manufactured by The Alien Group, 27 West 23 Street, New York, NY 10010.
For information on electronic adaptive aids for the handicapped, contact The Handlers, P.O. Box 13178, Tucson, AZ 85732.
Help-Mate (TM) System lOOO, uses a TRS-80 computer as part of a new communica­tion aid for the physically handicapped. Contact G&W Applied Science Laboratories, 335 Bear Hill Road, Waltham, MA 02154. (617) 890-5100.
Homework is an employment alternative program for the homebound, long-term disabl­ed employee. Contact Homework, Control Data Corporation, P.O. Box 0, Minneapolis, MN 55440.
Creative Computing, March 1982, Several articles are included that describe applica­tions of the personal computer for the handicapped. Write to Creative Computing, 39 East Hanover Avenue, Morris Plains, NJ 07950.
Softalk, February 1982, "Apples See, Hear, and Touch for Those Who Can't." Write Softalk, 11201 Magnolia Blvd., North Hollywood, CA 91601.
207
Apple, The Personal Computing Magazine. Volume 2, No. 2. "Voice Recognition" by Betsy Gilbert. Write Apple, c/o Apple Computer Inc., 10260 Bandley Drive, Cupertino, CA 95014.
For information on the International Apple Corps special interest group on applica­tions for the handicapped, contact: David McFarling, Handicapped SIG, International Ap­ple Corps, P.O. Box 976, Daly City, CA 94017.
"Electronic Aids for the Severely Handicapped," a free catalog of custom software and electronic devices for the communication-impaired, from Prentke Romich Co., R.D. 2, Box 191, Shreve, OH 44676.
"Communication Outlook/' a quarterly newsletter available for $12/yr from Artificial Language Laboratory, Computer Science Dept., Michigan State University, East Lansing, MI 48824.
If you have any additional information on hardware, software, adaptive aids, or other sources of other information, please send them to us so we can distribute this information to our members.
Who knows, maybe someday a youngster will walk up to you and say, "Thank you."
208
Appendix C Logo Procedures
The YPLA Software Exchange offers a wide range of software to members for free ex­change. Members may exchange any of their own programs or other public domain pro­grams for one of the disks (or tapes) in the YPLA catalog. This provides an average ratio of 15 programs for one of your own.
Several useful Logo procedures have been included here because they relate directly to information presented in the Sourcebook. These are also available through the YPLA catalog. For details on membership and The YPLA Software Exchange, contact the association at 1208 Hillsdale Drive, Richardson, TX 75081.
The Towers of Hanoi procedure from the YPLA Software Exchange is a classic example of recursion. Written in Apple Logo, the first procedure describes the game and provides instructions. This procedure then calls the procedures listed on the following pages, all in­cluded under the basic procedure, "Hanoi.Gamefile."
Graphics Dumps For The Appl
TI Logo and TI Logo II do not offer graphics or text dumping capabilities. The following procedures can be used with the Apple II and the Apple He. Your ability to print out graphics depends on the printer you are using, and the interface card used to access the printer,
You can printout Logo pictures on the Apple Silentype printer using one of several methods. COMPUTE Magazine published a dump program in Volume 4, Number 9, page 72. It allows you to dump all graphics developed on the screen. Should you wish to be more selective rather than have them all printed, consider the following procedure. We want to thank the people at the Dallas regional office of Apple Computer Inc. for contributing this and other procedures to our exchange.
TO PRINTPIC
.PRINTER 1
.DEPOSIT 65536 - 12524 0
.DEPOSIT 65536 - 12528 7
.DEPOSIT 65536 - 12529 255
PRINT CHAR 17
.PRINTER 0
END
209
Here is another from POLYSPIRAL, The Boston Logo User's Group Newsletter.
TO DUMP -.SLOT .PRINTER :SLOT .DEPOSIT 53007 128 .DEPOSIT 53012 0 PRINT CHAR 17 .DEPOSIT 53012 255 .DEPOSIT 53007 0 .PRINTER 0 END
For graphics dumps using the Grappler (TM) interface card from Orange Micro, consider the following procedure:
TO GRAPHICS.DUMP
.PRINTER 1
(TYPE CHAR 9 "G CHAR 13)
.PRINTER 0
END
To this procedure, you can add the following after the "G to achieve different effects:
"D for double-sized graphics "E for enhanced printing
"R to rotate the picture 90 degrees. This is generally required for double-sized prints, especial­ly on the EPSON MX-80 and Microline 82A.
"I to invert the picture so that it appears on paper as it appears on the screen - white lines on a dark background.
Other commands are listed in the Grappler documentation.
To use the graphics capabilities of the Epson printers with Epson interface requires you to crash out of Logo using .PRINTER 6. Then you can use the graphics programs included on their graphics disk.
Procedures similar to these can be used with MIT Logo using the OUTDEV command. For more information, refer to the MIT Logo technical manual.
210
TOWERS OF HANOI
TO INFO
CLEARTEXT SETCURSOR [13 0] REVERSE "INSTRUCTIONS
PR " PR "
PR [IN THE GAME CALLED fTOWER OF HANOI1 YOU]
PR [ARE PRESENTED WITH THREE TOWERS AND A]
PR [SET OF DISKS. THE OBJECT OF THE GAME IS]
PR [TO MOVE ALL OF THE DISKS FROM TOWERl TO]
PR [TOWER2. THE ONLY RULE IS THAT NO DISK]
PR [MAY BE PLACED ON TOP OF A SMALLER DISK.] PR "
PR [IF YOU MAKE A MISTAKE, HERE'S HOW TO]
PR [UNDO A MOVE: WHEN THE COMPUTER PRINTS,]
PR ["MOVE DISK FROM TOWER:", TYPE IN THE]
PR [LETTER "U" INSTEAD OF A NUMBER.]
SETCURSOR [13 14] PR [GOOD LUCK!]
SETCURSOR [0 19] PR [NOW READING IN HANOI.GAMEFILE FROM DISK]
PR [PLEASE WAIT___]
END
TO REVERSE :WORD
IF EMPTYP :WORD [STOP]
TYPE CHAR (ASCII FIRST :WORD) + 64
REVERSE BF :WORD
END
TO ERASE.KLUDGE
PACKAGE "HANOI [HANOI HANOI.PLAY]
BURY "HANOI
ERALL
UNBURY "HANOI
DEFINE "ERASE.KLUDGE []
LOAD "HANOI.GAMEFILE
END
TO HANOI.PLAY
CATCH "ERROR [IF AUTOMATIC? [AUTOLOOP :DISKNUM 12 3] [PLAYERLOOP]]
IF AGAIN? [HANOI]
END
TO HANOI
IF DEFINEDP "INFO [INFO]
ERASE.KLUDGE
GETDISKNUMBER
INIT.WORLD
HANOI.PLAY
END
211
TO CHECK.UNDO TEST EMPTYP FIRST :OLDMOVES
IFT [IF :MOVES > 4 [PR [I CANT REMEMBER THAT FAR BACK]]] PR [UNDO WHAT?] IFF [UNDOMOVE] MAKE "FROM "NIL END
TO RECORD.MOVE :LASTMOVE
MAKE "OLDMOVES FPUT rLASTMOVE BL -.OLDMOVES
END
TO UNDOMOVE
MAKE "FROM FIRST FIRST :OLDMOVES
MAKE "TO LAST FIRST :OLDMOVES
MAKE "OLDMOVES LPUT [] BF :OLDMOVES
MAKETOWERVARS
UPDATE.TOWERS
MOVE.DISK
END
TO SP
SETH 0 PU RT 90 FD 8 LT 90 PD
END
TO ROMAN.ONE
SETH 0 PU FD 5 PD RT 90 FD 1.7 BK 3
FD 1.5 LT 90 FD 10 LT 90 FD 1.5 BK 3 PU
RT 90 BK 15 RT 90 FD 3 LT 90 PU
END
TO DRAWDISKS :TOWER IF :TOWER = [] [STOP] RT 90 PD
FD 2 * FIRST :TOWER BK 4 * FIRST :TOWER FD 2 * FIRST :TOWER LT 90 SETPC 1 FD 5 DRAWDISKS BF :TOWER END
TO SETXY.TOWER :NUM
PU
IF :NUM = 1 [SETX -80]
IF :NUM = 2 [SETX -10]
IF :NUM = 3 [SETX 60]
SETY 0
SETH 0
END
>
TO DRAW.TOWERS
SETXY.TOWER 1
PD FD 70 ROMAN.ONE
SETXY.TOWER 2
PD FD 70 PU LT 90 FD 3 REPEAT 2
SETXY.TOWER 3
PD FD 70 PU LT 90 FD 4.5 REPEAT
[ROMAN.ONE] 3 [ROMAN.ONE]
BK 70 LT 90 BK 12.5 PD
212
FD 180 LT 90 FD 5 LT 90
FD 180 LT 90 FD 5
SETXY.TOWER 1
PU BK 70 RT 90 FD 12 LT 90
END
TO INIT.TOWER1 rDISKNUM
IF rDISKNUM = 0 [STOP]
MAKE "TOWER1 SE :TOWERl rDISKNUM
INIT.TOWERl rDISKNUM - 1
END
TO REMOVE
FD 5 * ((COUNT rTOWERF) - 1)
RT 90
PENERASE
FD 20
BK 20
PD
BK 2
PENERASE
B\< 20
PO
END
TO ADD
FD 5 * COUNT rTOWERT
RT 90 FD (LAST rTOWERF) * 2
BK (LAST rTOWERF) * 4
END
TO INIT.SCREEN
CS HT
DRAW.TOWERS
SETXY.TOWER 1
FD 5
DRAWDISKS rTOWERl
END
TO INIT.VARS
MAKE "OLDMOVES [[] [] [] [] []]
MAKE "MOVES 0
MAKE "TOWER1 []
MAKE "TOWER2 []
MAKE "TOWER3 []
INIT.TOWER1 rDISKNUM
END
TO INIT.WORLD INIT.VARS INIT.SCREEN END
213
TO GETDISKNUMBER
TYPE [HOW MANY DISKS DO YOU WISH TO USE (1-14)?] TYPE "
MAKE "DISKNUM FIRST READLIST
IF BETWEEN :DISKNUM 0 15 [STOP]
PR [THE NUMBER OF DISKS MUST BE BETWEEN 1 AND 14]
GETDISKNUMBER
END
TO AGAIN?
TYPE [WOULD YOU LIKE TO PLAY AGAIN?]
IF RC = "Y [PR "YES OP "TRUE]
PR "NO
OP "FALSE
END
TO PRMESSAGE
(PR [CONGRATULATIONS! YOU WON IN] :MOVES [MOVES]) END
TO WINP
OP COUNT :TOWER2 = :DISKNUM
END
TO MAKEMOVE
MAKE "MOVES :MOVES + 1
RECORD.MOVE LIST :TO :FROM
UPDATE.TOWERS
MOVE.DISK
END
TO LEGALMOVE
IF :FROM = "NIL [OP "FALSE]
IF NOT AND BETWEEN :FROM 0 4 BETWEEN :TO 0 4
[PR [THE ONLY TOWERS I CAN SEE ARE NUMBERED 1, 2, AND 3] OP "FALSE]
IF :FROM = :TO [PR [CONSIDER IT DONE] OP "FALSE]
MAKETOWERVARS
IF EMPTYP rTOWERF [PR [THERE ARE NO DISKS ON THAT TOWER] OP "FALSE]
TEST EMPTYP rTOWERT
IFF [IF LAST rTOWERF > LAST rTOWERT [PR [ILLEGAL MOVE] OP "FALSE]]
OP "TRUE
END
TO GETMOVE
(TYPE [MOVE DISK FROM TOWERr] " ) MAKE "FROM RC
IF -.FROM = "U [PR "UNDO CHECK.UNDO STOP] (TYPE rFROM " ) (TYPE [TO TOWERr] " ) MAKE "TO RC PR rTO END
214
TO PLAYERLOOP
GETMOVE
IF LEGALMOVE [MAKEMOVE]
IF WINP [PRMESSAGE STOP]
PLAYERLOOP
END
TO UPDATE.TOWERS
MAKE WORD "TOWER :TO SE :TOWERT LAST :TOWERF
MAKE WORD "TOWER :FROM BL :TOWERF
END
TO MOVE.DISK
SETXY.TOWER :FROM
PU FD 5 PD
REMOVE
SETXY.TOWER :TO
PU FD 5 PD
ADD
END
TO MAKETOWERVARS
MAKE "TOWERF THING WORD "TOWER :FROM
MAKE "TOWERT THING WORD "TOWER :TO
END
TO AUTOLOOP :DISKNUM :FROM :TO :OTHER
IF tDISKNUM = 0 [STOP]
AUTOLOOP :DISKNUM - 1 :FROM :OTHER :TO
MAKETOWERVARS
MOVE.DISK
UPDATE.TOWERS
AUTOLOOP :DISKNUM - 1 :OTHER :TO :FROM
END
TO BETWEEN :NUMBER rLOWLIM :HIGHLIM
IF NOT NUMBERP :NUMBER [OP "FALSE]
IF NOT REMAINDER :NUMBER 1=0 [OP "FALSE]
IF NOT AND :NUMBER > :LOWLIM :NUMBER < :HIGHLIM [OP "FALS
OP "TRUE
END
TO AUTOMATIC?
PR [TYPE fl! TO HAVE THE COMPUTER PLAY FOR YOU,]
PRINT [ANYTHING ELSE TO PLAY YOURSELF:]
IF BETWEEN RC 0 2 [PR "COMPUTER OP "TRUE]
PR "PLAYER
OP "FALSE
END
215
NOTES
1
216
Appendix D Logo for Preschoolers
One of the more exciting opportunities offered by Logo is working with very young children at the computer. Through a variety of single-keystroke procedures developed by YPLA staff and members, children as young as two years old have come to enjoy Turtle Graphics and the power of the computer. This is one of our favorite subjects and we look forward to developing a wide range of books and activities for this age group.
To introduce you to some of the fun of working with preschoolers, we have included two procedures written in Apple Logo. The first is derived from the Instant Program included in "Logo for the Apple II" by Harold Abelson, published by BYTE Books, Peterborough, New Hampshire. This program allows the child to develop a graphic procedure and then automatically save it by giving the drawing a name. This procedure can then be loaded into the computer at a later time for additional work or for review. It has been particularly useful at a school for the learning disabled in Dallas. The second procedure incorporates a few fun activities for both preschool and primary-grade children.
217
FROM KELLI, THIS FREDDIE.
i i: « ; i II t b u i t ii ii l f I! i : I 1> i'
FROM JIM, THIS IS LOGY, THE LOGO TURTLE,
■ I • I > I I I II • II I • I I M I I I H I I « • I I I < M M M • M r t •
r » » « ii » * m n 'i n * « i h e '- m » i » » ■• •>.
i r
• •«■■                g ■ •
..!
::i
H I I I I             I ■ I I ■
J T II « i ^ I ild t B U M I M J : II - t ^,'.i ■ L .1 ! » .|
218
TO RUN.ALL :CMDS IF :CMDS = [] [STOP] RUN FIRST :CMDS RUN.ALL (BF :CMDS) END
TO MENU2
TEXTSCREEN
CLEARTEXT
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
YOU CAN PRESS THESE KEYS, TOO!]
]
W: MAKE THE PEN WRITE] E: MAKE THE PEN ERASE]
]
D:   PUT THE PEN DOWN]
U:   PICK UP THE PEN]
I:   SHOW THE TURTLE]
0:   HIDE THE TURTLE]
]
PRESS ANY KEY TO CONTINUE DRAWING]
OP RC
END
TO MENU1
TEXTSCREEN
CLEARTEXT
PR PR PR PR PR PR PR PR PR PR PR PR PR PR PR PR PR PR PR PR END
PRESS ANY OF THESE KEYS:]
]
S:   SHOW THIS DRAWING]
H:   SHOW THIS HELP]
]
F:   MOVE THE TURTLE FORWARD 10 STEPS]
B:   MOVE THE TURTLE BACK 10 STEPS]
1-9: MOVE THE TURTLE FORWARD 1-9]
STEPS]
]
R:   TURN RIGHT 30 DEGREES]
L:   TURN LEFT 30 DEGREES]
T:   TAKE AWAY THE LAST COMMAND]
]
C:   CLEAR THE DRAWING]
]
N:   GIVE THE DRAWING A NAME AND SAVE I
A:   ADD A DRAWING TO THIS ONE]
]
Q:   QUIT DRAWING]
TO PROMPT :NEXT COMMAND :NEXT PROMPT READCHAR END
219
TO UNDO
IF :HISTORY = [] PR [THERE'S NOTHING TO TAKE AWAY] STOP
SPLITSCREEN
TYPE [TAKING AWAY:] PR LAST :HISTORY
CS
MAKE "HISTORY BUTLAST :HISTORY
PD ST SETPC 1
RUN.ALL :HISTORY
END
TO S
REPARSE
HOME
CLEAN
CLEARTEXT
MAKE "HISTORY []
SETPC 1 SETSCRUNCH 1
PROMPT MENU
END
TO R
CLEARTEXT CS PD
SETPC 1
RUN.ALL :HISTORY
PROMPT RC
END
TO LEARN
SPLITSCREEN
PR [WHAT DO YOU WANT TO CALL THIS DRAWING?]
MAKE "PROC RL
IF :PROC = [] [STOP] [MAKE "PROC FIRST :PROC]
IF DEFINEDP :PROC [TYPE [THERE'S ALREADY A DRAWING NAMED]
DEFINE :PROC FPUT [] :HISTORY
SAVE :PROC
TYPE :PROC PR [WILL BE THE NAME OF THIS DRAWING]
END
TO MENU TEXTSCREEN CLEARTEXT SETCURSOR [0 0] MENU1
PR []
PR [( PRESS "M" FOR MORE HELP )]
MAKE "CMD RC
IF :CMD = "M [MAKE "CMD MENU2]
OP :CMD
END
TO UNDOALL
IF :HISTORY = [] [STOP]
MAKE "HISTORY []
CS PD
END
220
TO ASK
SPLITSCREEN
PR [WHAT DRAWING DO YOU WANT TO ADD?]
MAKE "PROC READLIST
IF :PROC = [] [STOP] [MAKE "PROC FIRST :PROC]
IF NOT DEFINEDP :PROC [PR [THERE'S NO SUCH DRAWING!] STOP]
LOAD :PROC
EXEC LIST :PROC
END
TO EXEC .'ACTION
FULLSCREEN
RUN .-ACTION
MAKE "HISTORY (LPUT .'ACTION .-HISTORY)
END
TO COMMAND CLEARTEXT FULLSCREEN IF NUMBERP
C [EXEC SE "FD :C STOP]
ASK STOP]
EXEC [BK 10] STOP]
UNDOALL STOP]
EXEC [PD] SPLITSCREEN PR [PENDOWN] STOP]
EXEC [PE] SPLITSCREEN PR [THE PEN WILL ERASE]
EXEC [FD 10] STOP]
COMMAND MENU STOP]
EXEC [ST] STOP]
EXEC [LT 30] STOP]
LEARN STOP]
EXEC [HT] STOP]
TEXTSCREEN THROW "TOPLEVEL]
EXEC [RT 30] STOP]
FULLSCREEN STOP]
UNDO STOP]
EXEC [PU] SPLITSCREEN PR [PEN UP] STOP]
EXEC [PD] SPLITSCREEN PR [PEN DOWN] STOP]
DOESN'T DO ANYTHING]
STOP]
IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF
"A "B "C "D "E "F "H "I "L "N "0 "Q "R "S
II m
"u "w
SPLITSCREEN PR [THAT KEY END
TO DRAW PRINT [ENTER END
"S"]
221
F - FORWARD       B
L - TURN LEFT   R
C - CLEAR           #
T - TARGET         E
BACKWARD TURN RIGHT CHANGE AMOUNT ERASE ON/OFF
TO FUN MAKE "FAR 3 WRAP
SPLITSCREEN BOX
PRINT PRINT PRINT TYPE [ FUN.OBJ END
F -L -C -T -
FORWARD B
TURN LEFT R
CLEAR #
TARGET E -
• BACKWARD]
• TURN RIGHT]
■ CHANGE AMOUNT] ERASE ON/OFF]
TO PRINTPIC .PRINTER 1 .DEPOSIT (65536 .DEPOSIT (65536 PRINT CHAR 17 .PRINTER 0 END
12524) 12528)
TO PRESCHOOL
CS
PRINT [THIS IS A PROCEDURE FOR THE YOUNGER SET.]
PRINT []
PRINT [TO START, ENTER "FUN."]
END
222
TO MAKEGROAN
REPEAT 20 [MAKE "DAVID&DUDLEY .EXAMINE 49200]
END
TO MAKEGROAN2
REPEAT 5 [REPEAT 10 [MAKE "DAVID&DUDLEY .EXAMINE 49200] WAIT 1]
END
TO CHECK
OP ( AND FIRST POS > ( ( FIRST :TP ) - 10 )
FIRST POS < ( ( FIRST :TP ) + 10 ) LAST POS > ( ( LAST :TP )
LAST POS < ( ( LAST :TP ) + 10 ) )
END
- If
TO TOGGLE
IF FIRST PEN = "PENDOWN [PE] [PD]
END
TO TARGET
PU
SETPOS LIST (RANDOM 260) - 130 (RANDOM 100)
MAKE "TP POS
LT 90
FD 10
RT 90
PD
CIRCLER 10
PU
SETPOS LIST (RANDOM 260) - 130 (RANDOM 100)
PD
END
- (RANDOM 50)
- (RANDOM 50)
TO FUN.OBJ MAKE "KEY RC IF AND ASCII
:KEY > 47 [TARGET] [RT :FAR [LT :FAR [BK :FAR [FD :FAR [BOX] [TOGGLE]
ASCII :KEY < 58 [MAKE "FAR :KEY]
IF IF IF IF IF IF IF IF
KEY = "T
KEY =
KEY =
KEY =
KEY =
KEY =
KEY =
"R "L "B "F "C "E
5] 5]
5] 5]
CHECK
[MAKEGROAN2] [MAKEGROAN]
FUN.OBJ END
TO BOX
CS
HT
PU
SETPOS
PD
REPEAT
PU
HOME
PD
ST
END
[-139 -79]
2 [FD 199 RT 90 FD 278 RT 90;
223
NOTES
224
Appendix E Logo Cross Reference Guide
The following list provides a partial cross reference of the most common Turtle Geometry commands used in Apple Logo, Color Logo, CyberLOGO, MIT Logo, and TI LOGO. Ter­rapin Inc. and Krell Software Company both are licensees of the Massachusetts Institute of Technology, and market the same basic version of Logo.
Commodore Logo has been developed by Terrapin Inc. and will reportedly be very similiar to MIT Logo. It will, however, offer additional color capabilties. Interfacing commands will undoubtedly be different in that the Commodore 64 does not use slots as does the Apple II. There will also be differences in the Logo assembler which provides access to other graphics and sound capabilities.
Atari Logo, under development by Logo Computer Systems, Inc., will be a full implemen­tation of Logo in a cartridge. This can be expected to have many similiarities to Apple Logo.
225
APPLE LOGO
COLOR LOGO
CYBERLOGO
MIT
TI LOGO
FORWARD
FORWARD
FORWARD
FORWARD
FORWARD
BACK
BACK
BACK
BACK
BACK
RIGHT
RIGHT
RIGHT
RIGHT
RIGHT
LEFT
LEFT
LEFT
LEFT
LEFT
HOME
HOME
HOME
HOME
HOME
CLEARSCREEN
CLEAR
CLEAR
CLEARSCREEN
CLEARSCREEN
HIDETURTLE
HIDETURTLE
HIDE
HIDETURTLE
HIDETURTLE
SHOWTURTLE
SHOWTURTLE
HATCH
VANISH
SHOW
SHOWTURTLE
SHOWTURTLE
REPEAT
REPEAT
REPEAT
REPEAT
REPEAT
NODRAW
BREAK/EDIT
SCHOOL
NODRAW
NOTURTLE
CLEARSCREEN
(Reset)
CENTER
DRAW
CLEARSCREEN
CLEARTEXT
CLEARTEXT
CLEARSCREEN
TEXTSCREEN
TEXTSCREEN
NOTURTLE
FULLSCREEN
FULLSCREEN
SPLITSCREEN
SPLITSCREEN
TELL TURTLE
PENUP
PENUP
PENUP
PENUP
PENUP
PENDOWN
PENDOWN
PENDOWN
PENDOWN
PENDOWN
PENERASE
(1)
(1)
PENCOLOR 0
PENERASE
PENREVERSE
PENREVERSE
SETPC
PENCOLOR
PENCOLOR
PENCOLOR
SETCOLOR
COLORSET (2)
0 BLACK
0 CLEAR
0 BLACK
1 WHITE
1 BLACK
1 WHITE
1 WHITE
2 GREEN
2 GREEN
2 GREEN
2 GREEN
3 VIOLET
3 LIME
3 VIOLET
3 VIOLET
4 ORANGE
4 BLUE
4 RED
4 RED
5 BLUE
5 SKY
5 BLUE
5 BLUE
6 REVERSE/
6 RED
6 BLACK
6 COMPLEMENT
COMPLEMENT
7 CYAN
(for B&W TV)
8  RUST
9 ORANGE
10 YELLOW
11  LEMON
12  OLIVE
13  PURPLE
14 GRAY
15  WHITE
SETBG
BACKGROUND
BACKGND
BACKGROUND
BACKGROUND
EDIT
EDIT
EDIT
EDIT
EDIT
DOODLE
SKETCH
ERASE
ERALL
(Reset)
BYE
GOODBYE
BYE
LOAD
LOAD
LOAD
READ
RECALL
SAVE
SAVE
SAVE
SAVE
SAVE
PRINTER
P
PRINT
OUTDEV
ERASEFILE
REMOVE
ERASEFILE
CATALOG
PROGRAMS SAVE SCREEN LOAD SCREEN REMOVE SCREEN HELP
CATALOG
RECALL
226

Have a comment?

Comments