Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2...

9
Microworlds Pro B. Holkner 2001 Page 1 Getting Started with Microworlds Pro These notes are also suitable for Microworlds 2 (95) Dr Bernard Holkner [email protected]

Transcript of Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2...

Page 1: Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can

Microworlds Pro

B. Holkner 2001 Page 1

Getting Started with Microworlds Pro

These notes are also suitable for Microworlds 2 (95)

Dr Bernard Holkner [email protected]

Page 2: Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can

Microworlds Pro

B. Holkner 2001 Page 2

Monash University Microworlds has its origins in the LOGO programming language. There is a strong argument for the use of tools like LOGO since they are built upon a constructivist view of learning. Seymour papert and others at MIT have been at the forefront of these developments. The book “Mindstorms” presents the thinking behind LOGO in that it allows learners to “control the computer” rather than passively react to the adult logic of commercial educational software. It is also interesting to note the strong associations between Microworlds/LOGO and the LEGO group who have combined to develop several products which integrate the logic and power of LOGO with the constructive and problem solving capabilities of LEGO and LEGO technical equipment. The Microworlds Screen

The program results take place in the “Page” area Instructions to the programs you write are typed in the “Command Center” The “Tabs” allow you to view any Procedures that you create, project summaries and graphical options. Toolbar Details

Page 3: Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can

Microworlds Pro

B. Holkner 2001 Page 3

Importing a Picture Use File > Import Picture to locate the graphic. It can be moved around the screen at will. To Edit or delete a graphic, press the Graphics Tab, and the graphics tools will show.

These graphics tools operate as expected. For example you can select a colour, click the Paintcan and then the colour can be “poured” into a background.

Adding elements (Text)

Use the Text tool and type the text into the window.

When the mouse moves over the text box, it turns into a hand which can be used to move that text box around the screen. Change the appearance of the text by selecting the text and using ‘Font’ from the Text menu. You may need to use the selection tool (arrow) to select the textbox for moving or resizing.

Page 4: Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can

Microworlds Pro

B. Holkner 2001 Page 4

Adding elements (Music, sound, video)

NB. Use the Notes icon to play musical notes in the project. To insert recorded music (WAV files) use the Video icon. Create a tune Press the Notes icon and click the hand onto the Page The Music window lets you make up a simple composition.

Recorded music Use File > Import Music. Browse for the sound file “lteasy.wav” Once it’s in place, the sound should play correctly. Recording sound with the microphone is the same process. This is a very good way to create narrations for projects!

Page 5: Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can

Microworlds Pro

B. Holkner 2001 Page 5

New page Use the Pages menu to create page2. In the example application, this

is the first information page to follow the introductory material and will contain text and some images about cameras.

Note that the Project window now shows the elements of both pages. You can move between the pages with the Pages menu.

Navigation For other people to use this program, some navigation buttons will be needed. These are simply buttons that tell the program to turn to another page. Buttons can of course control many other functions. Click the Button tool and draw a button on page2. Give this the Instruction “page1. When you click on this button the function of changing pages takes place. Create a button on page1 that will move to page2.

Working with Turtles Microworlds allows turtles to assume different shapes. There can be

many turtles on a screen at one time if you wish. Page2 is going to have an animation created by a turtle. Use the Hatch turtle button and place the new turtle on the screen. Choose a shape from the graphics tab and click on the turtle to give it that shape.

Use the Right Mouse Button to edit this turtle. In the sample it was renamed to “bird”.

Page 6: Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can

Microworlds Pro

B. Holkner 2001 Page 6

Programming Turtles Use the Procedures Window to program turtles. This example teaches the turtle “to flap” to flap setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can be tested by typing

Flap …into the command centre below the page. How does it work? A more realistic effect might be to use “flap” in a repeat sequence. Type Repeat 50[flap] …into the command centre and see the effect.

Here’s a challenge: Make the bird fly around the page…

LOGO Primitives fd bk Lt rt Pu (penup) Pd (pen down) St (show turtle) Ht (hide turtle) Cg (clear graphics &

sends turtle home) Cc

(clear command centre)

Np (Name the page) e.g. np “Introduction

Setsh (set shape) e.g. setsh “bird1

LOGO Syntax Repeat

Repeat 16[fd 16 rt 120]

Use variable e.g. square 46

To square :long Repeat 4[fd :long rt 90] End

Talk to one turtle tto "fizzy fd 90 tto "t2 rt 90

Page 7: Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can

Microworlds Pro

B. Holkner 2001 Page 7

Creating a Scene Import a picture File > Import Picture e.g. Mill.jpg

Create a Title for the program

Click the Text tool and draw a box. Select Font style and size Type the heading. To change the font size, using Edit > Select All, then Font > etc

Create a Button Chose the Button tool and draw a button. Give it the instruction About This means that when it’s pressed, the button will run a procedure called About (whatever that might be) Create similar buttons for other parts of the project. Use the Magnifying glass tools to enlarge or reduce objects. Use the scissors tool to remove objects.

New Page This project will have a new page for each piece of information. Use Pages > new Page to create a new page. Use pages > Name Page to name it About This means that the “About” button on page1 will switch the program to the “About” page. Create a button on the About page to go back to page1 Create similar pages for other parts of the project…

Page 8: Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can

Microworlds Pro

B. Holkner 2001 Page 8

Graphics Programming Use the Procedures Page to write these procedures (programs). Flip back to the Page to try them out. (Use ctrl-F to “flip pages”) Type pd (pendown) to see the trails made by a turtle. Regular Shapes To square

Repeat 4[fd 60 rt 90] End To spinsquares Repeat 12[square rt 30] End To poly :much Repeat :much[fd 60 rt 360 / :much] End (Note that the Variable called “much” is going to be the number of sides of the polygon. To use the procedure, we need to type poly 6 or poly 12 and so on.)

Working with Text or Lists – Examples Asking a question Very easy

To ask2 Question [Are you ready to start?] If answer = “yes [setbg “red] end Easy To askit question [Who are you?] announce (se [Nice to meet you] answer ) end (Note that announce se means announce in a sentence.) More difficult To clever question [How old are you?] if not number? answer [insist stop] announce (se [you'll be] answer + 10 [in ten years]) end (This example makes sure that the response was a number.)

Page 9: Microworlds Pro Getting Started with Microworlds Pro These ... · setsh "bird1 wait 1 setsh "bird2 wait 1 end Type this text into the procedures window. Now the new procedure can

Microworlds Pro

B. Holkner 2001 Page 9

Asking questions for a quiz or questionnaire.

to quiz1 question [What's your name?] make "name answer question [How old are you?] make "age answer end (The make instruction stores that response so that it can be reused at any time while the program is running.) to answers2 announce (se :name [is] :age) end to checkup if less? :age 20 announce (se[You are too young..]) end A Sample Quiz to quizmill question [When was the first mill built?] make "builtdate answer question [How was it powered?] make "powered answer question [What was the mill used for?] make "usedfor answer end To checkanswers Ifelse :builtdate = 1822 [Announce (se [Yes the first mill was built in 1823]] [Announce (se [No the first mill was built in 1823, not] :builtdate)] ifelse :powered = "water [Announce (se[Yes it was powered by water])] [Announce (se[No it was powered by water, not ] :powered)] End