190 likes | 538 Views
LOGO. CECS 4100 R. Christensen. What is LOGO?. LOGO is a modern, procedural programming language based on the artificial intelligence language LISP. Although appropriate for beginners, it is a highly sophisticated language. What is LOGO?. LOGO is a procedural language.
E N D
LOGO CECS 4100 R. Christensen
What is LOGO? • LOGO is a modern, procedural programming language based on the artificial intelligence language LISP. • Although appropriate for beginners, it is a highly sophisticated language.
What is LOGO? • LOGO is a procedural language. • LOGO is an interactive language. • The programmer receives immediate feedback. • LOGO has turtle graphics. • LOGO uses lists as data objects. • Numbers, characters, and words can be manipulated in LOGO. • Lists are compound data structures.
LOGO’s Philosophy for Computer Use in the Classroom • Seymour Papert is the Father of LOGO. • His theoretical background comes from the area of artificial intelligence and from the work of Jean Piaget. • Papert believes the computer is best used in education as an “object to think with” rather than a dispenser of information.
What is a MicroWorld? • The concept of “microworld” is one Papert used to describe LOGO and LOGO-like environments. • An environment for learning in which children are free to experiment, test, and revise theories, and invent their own activities.
Versions of LOGO • Original microcomputer versions were available in 1979 for the TI 99/4 home computer and the Apple II computer. • LCSI LOGO is what we are using • Available for IBM and Apple • Terrapin LOGO for Apple II family • LOGOWriter (LCSI) combines LOGO and word processing
Why Use LOGO? • Provides a sound introduction to programming but is more than a programming language • Encourages thinking and problem-solving skills applicable across the curriculum • Debugging • Learning from errors - immediate feedback • Creates an ideal environment for experimenting and learning hypothesis-testing skills
Research on LOGO • May facilitate achievement gains in the area of mathematics • May facilitate problem-solving ability • Evidence indicates that LOGO can serve as a powerful tool in encouraging prosocial interaction, positive self-image, positive attitudes toward learning. • In general, evidence suggests that working in pairs is most advantageous for LOGO
Programming in LOGO • The Primitives • commands LOGO “knows” • FD (forward) • BK (backward) • RT (right) • LT (left) • HOME (goes to home position) • PU (lifts the pen) • PD (puts the pen down)
Programming in LOGO • Perspective - sitting on the turtle’s back • Procedures • Teaching the turtle new tricks • TO SQUARE • REPEAT 4[FD 50 RT 90] • END • Procedures are called from the main program
Programming in LOGO • Using LOGO variables • Allows an assigned value to a variable so the procedure can be used multiple times with different values • TO SQUARE:SIDE • REPEAT 4[FD :SIDE RT 90] • END • Square is the procedure, side is the variable so the square procedure can be used for multiple sizes of squares
Programming in LOGO • What would happen here? • TO SQUARE • REPEAT 4[FD 50 RT 90] • SQUARE • END
Programming in LOGO • Recursion is an endless loop • Can be stopped if a conditional statement is used • IF :SIDE > 100 STOP • TO SPIRAL :SIDE • IF :SIDE>100 STOP • SQUARE :SIDE • RT 10 • SPIRAL :SIDE+5 • END
Programming in LOGO • LOGO numbers, words and lists • LOGO “knows” how to add, subtract, multiply and divide (+,-,*,/) • The command PRINT (3+5)/2*8 will output 32 • To indicate the data-type word, type a quotation mark in front of the string • PRINT “Happy Birthday • Output Happy Birthday
Programming in LOGO • LOGO Lists • A list is a group of words indicated by brackets • PRINT [TODAY IS TUESDAY] • Output TODAY IS TUESDAY • Can teach the computer “how to talk”, how to create sentences and how to write poetry
Programming in LOGO • LOGO Music • Command is TONE followed by 2 inputs - one is frequency (pitch) and the second is duration • TONE 300 60 • Procedure for music might be • TO SONG • TONE 252 56 • TONE 349 56 • TONE 365 56 • END
Programming in LOGO • Using music in procedures and subprocedures • TO MUSIC • REPEAT 5 FIRST • where first is the name of the first part of the song • SECOND • second is the name of the second part of the song • THIRD • third is the name of the third part of the song • END