logo programming what is logo? logo is one of a number of computer languages to have been developed...

43
Logo Programming

Upload: ambrose-greer

Post on 18-Dec-2015

228 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Logo Programming

Page 2: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

What is LOGO? LOGO is one of a number of computer languages to have

been developed in the field of Artificial Intelligence. LOGO was developed at the Massachusetts Institute of

Technology in the late 1960's as part of a research project to create a language for the teaching of mathematical ideas to children through computer programming.

It was intended to be easy to learn, easy to use, easy to read, but also powerful, and therefore able to cope with complex activities.

LOGO was evolved by a team including Wallace Feurzeig (who suggested the name LOGO), Cynthia Solomon and the man who is now the most well-known LOGO figure, Seymour Papert.

Page 3: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Different versions

MSW Logo HKU Logo PC Logo StarLogo (used for modeling)

HKU Logo Vs MSW Logo

Page 4: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

HOW DOES LOGO WORK?

Logo programs are built up through the use of procedures.

A computer program in LOGO is just a collection of procedures which achieve a particular objective.

The work TO is used when creating ('defining') procedures; this is to emphasize the way we can think of procedures as being like verbs.

Page 5: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

LOGO and THINKING

Proponents of LOGO argue that LOGO programming can be seen as a direct analogy of the thinking process itself.

The similarity between the building up of LOGO programs and the building up of thought-structures is clear. The  evolution of a LOGO program by developing and testing simple procedures, then incorporation them in more complicated ones can to some extent parallel the process of thinking.

For Papert, this similarity between LOGO-work and 'thought-work' is what makes LOGO not just a programming language but a 'tool to think with'.

Learning, at any level, proceeds by a process of trial and error.

Page 6: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

LOGO and THINKING

The unexpected response is seen as a  positive step in the right direction, and the learner is encouraged to think about why the unexpected result occurred. Unexpected results are therefore seen as useful stages in the learning process.

'Debugging', is considered to be an essential part of the learning process, by which conceptual structures are tested and altered until found acceptable.

'Bugs' are not seen as 'wrong answers' but as unexpected outcomes which should stimulate thinking and lead to the mastery of ideas that comes from an understanding of how to use them successfully.

Page 7: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

LOGO and SCHOOLS

LOGO is often suggested as ' ideal computer language for children' ; and most of the current interest in it comes from educational practitioners.

What does LOGO offer schools in particular?

Page 8: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

The main justification for LOGO-use in schools arises from the nature of the LOGO-use in schools arises from the nature of the LOGO learning experience. Exploration and discovery are generally accepted as essential parts of the experience which the schools can offer.

LOGO also offers a ready avenue into familarisation with and general use of the computer

LOGO offers an introduction to computer programming which is highly structured and encourages 'top-down' programming.

The importance of 'debugging' in learning has been mentioned above.

Page 9: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

It is a common observation of those who have used LOGO in the classroom, that LOGO is enjoyable. The fact that learning is enjoyable is not trivial, for enjoyment in learning is a source of motivation and of concentration.

LOGO is most effectively used with groups, and when so used enables the learning benefits of group activity to be obtained.

Because of the range of 'microworlds' which it can support. LOGO can be used to allow children to explore various and different elements of the curriculum, while maintaining a unity of good thinking practice.

Page 10: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Logo as a Programming Language

Logo is procedural Logo is interactive Logo is recursive Logo has list processing Logo is not typed Logo is extensible

Page 11: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Logo as a Learning Language

Logo, though, was developed as a learning language, not for a specific branch of mathematics, but for problem-solving behavior.

Logo is 'tuned' for interesting applications. Logo is user-friendly. Logo has no threshold and ceiling. Logo is for learning learning.

Page 12: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

What facilities Does LOGO offer? Different sets of LOGO facilities can place the user in

different 'micro-worlds' which can become environments for exploration and discovery, and thus environments for learning.

Some micro-worlds : the 'turtle world' of the plane geometry the 'music world' the 'dynaturtle world' of movement in outer space; database possibilities; robotics and control possibilities; facilities for poetry and creative writing etc

Page 13: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Learning Styles Planner

likes to build structured programs from the top level down or from the bottom level up, but always from a coherent formulated plan.

macro-explorer likes to mess about with subprocedures or building blocks

to arrive at a product, rather than starting out with a specific goal.

micro-explorer explore their environment on a microlevel before they can

establish patterns of planning or directed exploration.

Page 14: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

As Logo is a popular programming language, there exists different versions of Logo. In your school, you may find the following versions: HKU Logo (CGA version) HKU Logo (VGA version) PC Logo for DOS PC Logo for Windows MSW Logo

Page 15: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Some differences ….

Page 16: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Working environment of HKU Logo.

The Upper part is the graphic window while the lower part is the text window. You can type the commands in the text window to instruct the turtle

Graphic Window

Text Window

Page 17: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Input Box

Output/Command-Recall List Box

The turtle

Commander Window

Command buttons

Menu Bar

Turtle's Playground

MSW LOGO

The turtle is sitting at the centre of its playground. Down below the playground is the Commander window. To instruct the turtle, you simply type the commands in the Input Box and click on the execute button (or just press the ENTER key) to execute them

Page 18: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Learn Turtle’s ABC

Add these instructions and remember to press the Enter key at the end of each instruction.

?FD 50?RT 90?FD 40?LT 90?BK 100

?FD 50

Press the spacebar to add a space here.

Press the Enter key at the end of each instruction.

(for HKU Logo users)

Page 19: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Learn Turtle’s ABC (for MSW Logo users)

Press the spacebar to add a space here.

Press the Enter key at the end of each instruction.

Add these instructions andremember to press theEnter key at the end ofeach instruction.

FD 50RT 90FD 40RT 90BK 100

Page 20: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

First procedure for HKU Logo user

?TO SQUARE>REPEAT 4[FD 100 RT 90]>ENDSQUARE DEFINED?

The prompts aredifferent!

You can enter the Logocommands when you see thequestion mark (?) again.

Logo tells you that theprocedure called SQUAREhas been defined.

Page 21: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

The above procedure can be used to draw a square. If you want to use the procedure, you only need to type the name of the procedure after the prompt ‘?’, for example,

?SQUARE

and then a square will be drawn.

Page 22: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

First procedure for MSW Logo user

Type to square in the input box

In MSW Logo, the commands can be typed in upper or lower cases.

Page 23: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

You will see a dialog box which let you input the Logo commands.

Type repeat 4[fd 100 rt 90] and press Enter.

Page 24: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Input end to indicate that you have completed procedure.Remember to press Enter or click the OK button

Page 25: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Logo tells you that the procedure called SQUARE has been defined.

The commander box will tell you that your procedure has been defined

Page 26: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

The above procedure can be used to draw a square.

If you want to use the procedure, you only need to type the name of the procedure in the input box.

Page 27: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

A square will be drawn on screen.

Page 28: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Group ActivityCompare and contrast HKU LOGO with MSW LOGO

Working environment Basic Movements Procedures Workspace and file management Flow control Project Handling

Try to compare and contrast these two versions of LOGO in the following aspects:

Page 29: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Designing a programming project

Page 30: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

How to tackle a Logo Project

Defining the problemDefining the problem

Setting up appropriate goalsSetting up appropriate goals

Completing the project and sharing your work with others

Completing the project and sharing your work with others

Debugging and Revising the projectDebugging and Revising the project

Creating a Working DraftCreating a Working Draft

Page 31: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Some hints for developing Logo projects:

Top-down analysis Modular approach State-transparent Meaningful variable names and procedure

names

Page 32: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Project example:

Page 33: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Defining the problem

I want to ask the turtle to build a house.

Page 34: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Setting up appropriate goals

My dream house should have a roof, a door, walls and windows.

Page 35: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Creating a working draft

Page 36: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

HouseHouse

RoofRoof

WallWall

DoorDoor

TriangleTriangle

WindowWindow

Wall faceWall face

Rectangle 2Rectangle 2

Rectangle 3Rectangle 3

Rectangle 1Rectangle 1

Page 37: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

TO TRIANGLE REPEAT 3 [FD 80 RT 120]END

TO ROOF RT 30 TRIANGLE LT 30END

Page 38: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

TO WALL WALLFACE RT 90 FD 25 LT 90 DOOR RT 90 BK 25 LT 90 PU FD 80 RT 90 FD 10 LT 90 PD WINDOW1 PU BK 80 LT 90 FD 10 RT 90 PD PU FD 80 RT 90 FD 50 LT 90 PD WINDOW1 PU BK 80 LT 90 FD 50 RT 90 PDEND

Page 39: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

The house can be built now!

TO HOUSE

WALL

FD 100

ROOF

BK 100

END

Page 40: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Debugging and Revising

:LENGTH

:HEIGHT

:HEIGHT*60/100

:HEIGHT*10/100:LENGTH*30/80

:LENGTH*20/80

Page 41: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

Completing the project and sharing your work with others

TO TRIANGLE :LENGTH REPEAT 3[FD :LENGTH RT 120]END

TO RECTANGLE :H :L REPEAT 2 [FD :H RT 90 FD :L RT 90]END

HouseHouse

RoofRoof

WallWall

DoorDoor

TriangleTriangle

WindowWindow

Rectangle Rectangle

Rectangle Rectangle

Wall faceWall faceRectangle Rectangle

Page 42: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

To be a Town Planner

Page 43: Logo Programming What is LOGO? LOGO is one of a number of computer languages to have been developed in the field of Artificial Intelligence. LOGO was

How to design an IT task for learning Logo?

Activity

Try to draft a learning task for a selected Logo topic.