Computer Science 1000 LOGO I. LOGO a computer programming language, typically used for education an old language (1967) the basics are simple: move a.

Slides:



Advertisements
Similar presentations
First of all – lets look at the windows you are going to use. At the top you have a toolbar, with all your various tools you can use when customising your.
Advertisements

Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Logo Lesson 1 TBE Fall 2004 Farah Fisher.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
UNESCO ICTLIP Module 4. Lesson 3 Database Design, and Information Storage and Retrieval Lesson 3. Information storage and retrieval using WinISIS.
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.
Using Logo and Logic Please use speaker notes for additional information!
Computer Science 1620 Loops.
Computer Science 1620 Variables and Memory. Review Examples: write a program that calculates and displays the average of the numbers 45, 69, and 106.
EGR 106 – Week 2 – Arrays & Scripts Brief review of last week Arrays: – Concept – Construction – Addressing Scripts and the editor Audio arrays Textbook.
Logo Lesson 3 TBE 540 Fall 2004 Farah Fisher. Prerequisites for Lesson 3 Before beginning this lesson, the student must be able to… Use simple Logo commands.
Logo Lesson 2 Logo Procedures
B.A. (Mahayana Studies) Introduction to Computer Science November March Logo (Part 1) An introduction to Logo: drawing, moving,
What is Scratch? Scratch as Logo Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
Introduction to programming in MATLAB MATLAB can be thought of as an super-powerful graphing calculator Remember the TI-83 from calculus? With many more.
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
Summer Computing Workshop. Session 4 Loops  At the heart of their functionality, loops enable blocks of code to be executed more than once  Loops represent.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Making a Timer in Alice.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
Karel J Robot An introduction to BlueJ and Object- Oriented Programming.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Introduction to Computational Linguistics Programming I.
LOGO SOFTWARE BY: SAVE 9S. INTRODUCTION Logo is a software that can be found at : Shared area> High School > ICT > take home software > LOGO32. This is.
B.A. (Mahayana Studies) Introduction to Computer Science November March Logo (Part 2) More complex procedures using parameters,
Chapter 6: User-Defined Functions
A SIMPLE COMPUTER LANGUAGE LOGO. LOGO Introduction Logo is the simplest programming language. It.
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
A tiny turtle robot DEI The University of Padova.
Copyright © Curt Hill Turtles The beginning of media computation.
MSW Logo By Awin 9s.
Logo For beginners By Dali Matthews 9S What is logo?
An introduction to Logo Mike Warriner Engineering Director, Google Note: This course is not an endorsement of Logo by Google. All views in this document.
Programmming Class Fall 2011 Sobhan Highschool Teacher: M.Taghizadeh.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Logo Programming Fall 2011 – Session 4 Programming Class Teacher: M. Taghizadeh Sobhan Highschool.
ISU Basic SAS commands Laboratory No. 1 Computer Techniques for Biological Research Animal Science 500 Ken Stalder, Professor Department of Animal Science.
CONTROL SYSTEMS Control Systems A command is a directive that performs a specific task An argument is a variable that can be used by the function reveiving.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Programmming Class Fall 2011 – Session 2 Teacher: M.Taghizadeh
The Hare Raising Experience of Logo in the Classroom
Logo Programming Fall 2011 – Session 7 Programming Class Teacher: M. Taghizadeh Sobhan Highschool.
Roamer help file: Use this power-point slide to find out more about the buttons on Roamer…
You Need an Interpreter!. Closing the GAP Thus far, we’ve been struggling to speak to computers in “their” language, maybe its time we spoke to them in.
By Liam Lane How To Use MSW LOGO.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
Copyright 2002, Tony Gauvin, UMFK
LOGO CECS 4100 R. Christensen.
Logo for Beginners By Chris 9S.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
LOGO For the beginner Made by Rio Narazaki. W HAT I S L OGO ? Logo is a computer programming language used in Education. Logo is very easy to use. The.
First of all – lets look at the window’s you are going to use. At the top you have a toolbar, with all your various tools you can use when customising.
Turtle Graphics Lesson 2 1. There are 3 homeworks to complete during the six lessons of this unit. Your teacher will let you know when a homework has.
Search for it on your computer
LOGO WHAT IS IT? HOW TO USE IT AND HOW USEFUL CAN IT BE?
What is it? How to use it and how useful can it be?
Computer Science 1000 LOGO II. Boolean Expressions like Excel and Scratch, LOGO supports three Boolean operators less than (
Computer Programming.
Release Numbers MATLAB is updated regularly
Using Logo to develop logical thinking
LOGO BY Kaotip 9S.
LOGO 32 By: Xenon 9S.
SQL and SQL*Plus Interaction
Learning to program with Logo
Ellie DeGiorgio-Hudson
Institute for Entrepreneurship and Career Development (IECD)
Using Logo and Logic This presentation uses a version of Logo called StarLogo available through MIT. It can be downloaded for free and installed on your.
CSCI N207 Data Analysis Using Spreadsheet
Presentation transcript:

Computer Science 1000 LOGO I

LOGO a computer programming language, typically used for education an old language (1967) the basics are simple: move a “turtle” around the screen the turtle can leave a “trail” using its pen even though it’s basic, very effective at teaching elementary programming concepts input/output, variables, loops, conditionals we will be using MSWLogo (free download, installed in labs)

Output Window Commander Window Turtle

LOGO Commands like other programming languages (e.g. Scratch), LOGO programming is made up of statements termed as commands basic syntax: e.g. … forward 10

LOGO – Interactive one of the easiest ways to use LOGO is to use the commander window type a command press Enter or press Execute two responses the command will be shown in the history the turtle will respond

Logo – Basic Movement forward moves the turtle forward indicates how many steps to move back moves the turtle backward indicates how many steps to move the direction of movement depends on which way the turtle is facing

Logo – Basic Movement many LOGO commands have a shorthand forward : fd back : bk these shorthand values are particularly useful when these commands are part of other commands

Movement note that both forward (fd) and back (bk) can take a negative value as input if fd, then moves backward if bk, then moves forward

Turning left turns the turtle counterclockwise by specified number of degrees shorthand: lt right turns the turtle clockwise by specified number of degrees shorthand: rt

Movement the direction that the turtle is facing affects the result of the forward and back commands simply stated, the turtle always moves in the direction it is pointing

Reset to reset the direction of the turtle, press the Reset button you can also use the cs command (short for clear screen)

Reset Pressed

Multiple Operations like Scratch, the power of LOGO programming is in combining multiple commands a simple way to do this: place multiple commands on the same line, separated by spaces

Example: draw a square with side length 100 Solution: forward 100 steps turn 90 degrees right forward 100 steps turn 90 degrees right forward 100 steps turn 90 degrees right forward 100 steps turn 90 degrees right

Loops LOGO offers similar looping functionality to Scratch the simplest loop: repeat syntax: repeat [ … ] These commands will be repeated this many times.

Example: Modify previous example: draw a square with only one fd and one rt command

Example: Modify the previous example to draw an octagon, sides of length 60 Solution: fd 60 steps turn 45 degrees Repeat 8 times

Pen Status all of the turtle movements thus far have resulted in a line being drawn behind the ability to draw is known as the turtle’s pen by default, it’s pen is down and a line is drawn we can lift the pen using the command pu (short for pen up)

Notice that no line is drawn behind turtle.

Pen Status we can drop the pen, and start drawing again, using the pd command (short for pen down) example: write a program that draws a dashed line, with each dash of length 10

Print LOGO allows us to print a value useful for debugging to print a number print to print text print “

Math LOGO allows us to do basic math, similar to both Excel and Scratch operators + : addition - : subtraction * : multiplication / : division

Math math expressions are typically used in other LOGO commands

Variables recall that a variable refers to named memory storage LOGO allows the use of variables built-in (like the Scratch answer block) user-defined we use a variable simply by writing its name

repcount a built-in variable used inside a repeat loop stores a number that number changes each time through the loop first time through the loop: 1 second time through the loop: 2 and so on ….

repcount can be used as input to other commands example: rewrite our dashed line example, but make each dash successfully larger than the next first dash: 10 units second dash: 20 units third dash: 30 units and so on …

Procedures a procedure allows us to define our own commands syntax: to end

Example: write a procedure called square that draws a square of side size 50 to square repeat 4 [ fd 50 rt 90 ] end

Procedures where do we define a procedure? Click the Edall button an editor window will pop up, for program entry your lab experience suggests an alternative method, if you prefer EdAll Button

From previous example: When you are finished editing, click File -> Save and Exit

Procedures once you have defined and saved a procedure, you can call it just as you would any other command

Procedures procedures can have more than one command for example, write a procedure that draws an X Solution: turn 45 degrees to the right forward 100 steps backward 200 steps forward 100 steps turn 90 degrees to the right forward 100 steps backward 200 steps forward 100 steps

Procedures just like other commands can be called in procedures, other procedures can also be called for example, write a procedure called squareX, that draws both an X, and a square

Input just like commands, procedures can take parameters also called inputs syntax: to procedure :param1 :param2... commands end

Input when we call a procedure with parameters, we must supply a value for those parameters when we call a procedure the parameters can then be used as a variable don’t forget the colon to printTwice :val print :val end

Example: write a procedure called dashedLine, that takes a number X as input, and draws X dashes