BPC: Art and Computation – Summer 2007 Computer Programming with Logo Glenn Bresnahan

Slides:



Advertisements
Similar presentations
Algorithm Design Techniques
Advertisements

Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
Chapter 3 Program Design And Branching Structures.
Computer Science 1000 LOGO I. LOGO a computer programming language, typically used for education an old language (1967) the basics are simple: move a.
June 1, 2000 Object Oriented Programming in Java (95-707) Java Language Basics 1 Lecture 4 Object Oriented Programming in Java Class Design Process.
The Turtle Laboratory Sequence Myles McNally LMICSE Workshop November , 2004 University of Mississippi.
BPC: Art and Computation – Summer 2007 Overview of Fall Semester Glenn Bresnahan
BPC: Art and Computation – Summer 2007 Course Overview Glenn Bresnahan
BPC: Art and Computation – Spring 2007 Overview of Spring Semester Tools and Technologies Glenn Bresnahan
Logo Lesson 5 TBE Fall 2004 Farah Fisher. Prerequisites  Given a shape, use basic Logo commands and/or a procedure to draw the shape, with and.
CHAPTER 4: ALGORITHM 4.1 Introduction stages identified in the program development process: 1. Problem analysis and specification 2. Data organization.
By: Monique McTague.  An educational programming language designed in 1967 by Daniel G. Bobrow.  Logo was derived from the Greek logos meaning word.
Using Visual Logic To Teach A First Course In Programming Logic
Foundation Programming Introduction. Aims This course aims to give students a basic understanding of computer programming. On completing this course students.
Lecture 4 MATLAB Windows Arithmetic Operators Maintenance Functions
Graphics Graphics Korea University cgvr.korea.ac.kr Model Construction 고려대학교 컴퓨터 그래픽스 연구실.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
©Brooks/Cole, 2003 Foundations of Computer Science from Data Manipulation to Theory of Computation Behrouz A. Forouzan, Brooks/Cole — Thomson Learning,
Introduction. 2COMPSCI Computer Science Fundamentals.
B.A. (Mahayana Studies) Introduction to Computer Science November March Logo (Part 2) More complex procedures using parameters,
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
1 Logo -- A Language for Learning Liping Cai 11/21/2005.
Piotr Wolski Introduction to R. Topics What is R? Sample session How to install R? Minimum you have to know to work in R Data objects in R and how to.
Introduction to Computer Programming Using C Session 23 - Review.
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.
Chapter 1. Objectives To provide examples of computer science in the real world To provide an overview of common problem- solving strategies To introduce.
The development of common partnership and interuniversitary scientific research according to the principle of sustainable development TRAINING COURSE Romania,
1 DKT 211 Basic Communication Engineering LAB # 1A : (Lecture 1) Introduction to Matlab  Basic Features  Scientific features  Array Operations  Script.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 5 - Functions Outline 5.1Introduction 5.2Program.
Algorithms Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006 by Maria Litvin, Gary Litvin,
Basic Scheme February 8, 2007 Compound expressions Rules of evaluation Creating procedures by capturing common patterns.
2016 N5 Prelim Revision. HTML Absolute/Relative addressing in HTML.
LOGO CECS 4100 R. Christensen.
Foundation of Computing Systems
STL CSSE 250 Susan Reeder. What is the STL? Standard Template Library Standard C++ Library is an extensible framework which contains components for Language.
Chapter 4 Introduction to Control Statements
Methods Chapter 6. 2 Program Modules in Java What we call "functions" in C++ are called "___________________" in Java Purpose –Reuse code –Modularize.
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
Programming Training kiddo Main Points: - Python Statements - Problems with selections.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Understanding Naturally Conveyed Explanations of Device Behavior Michael Oltmans and Randall Davis MIT Artificial Intelligence Lab.
BPC: Art and Computation – Summer 2007 Overview of Spring Semester Glenn Bresnahan
Progression in KS3/4 Algorithms MONDAY 30 TH NOVEMBER SUE SENTANCE.
C_ITIP211 LECTURER: E.DONDO. Unit 3 : PROCESS MODELING.
CS 1428 Final Exam Review. Exam Format 200 Total Points – 60 Points Writing Programs – 45 Points Tracing Algorithms and determining results – 20 Points.
Chapter INTRODUCTION Data Types and Arithmetic Calculations.
5. Algorithm 1: Variables, Operators, Sequences 1.
Computer Programming.
PRE-AP computer science 1
1-1 Logic and Syntax A computer program is a solution to a problem.
Chapter 2- Visual Basic Schneider
September 4, 1997 Programming Languages (CS 550) Lecture 6 Summary Operational Semantics of Scheme using Substitution Jeremy R. Johnson TexPoint fonts.
Organization of Programming Languages
MATLAB DENC 2533 ECADD LAB 9.
Lecture 2: Introduction to Algorithms
Programming Right from the Start with Visual Basic .NET 1/e
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 2- Visual Basic Schneider
CS 1428 Final Exam Review.
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Graphics Animation Using Terrapin LOGO
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Unit 3 lesson 2-5 The Need For Algorithms- Creativity in Algorithms – Simple Commands - Functions Day 18.
6.001 SICP Interpretation Parts of an interpreter
Lecture 3 Pseudocode (S&G, §2.2)
Introduction to the Lab
CMPT 120 Lecture 19 – Unit 3 – Graphics and Animation
CMPT 120 Lecture 18 – Unit 3 – Graphics and Animation
Using Modules.
Presentation transcript:

BPC: Art and Computation – Summer 2007 Computer Programming with Logo Glenn Bresnahan

BPC: Art and Computation – Summer Synopsis Introduction to computer programming and the Logo programming language Concepts of programming, computer languages and algorithms Programming constructs Combination of lecture and hands-on labs -Class-LogoNotes.doc -Class-LogoNotes.doc (to be provided) Example programs (to be provided)

BPC: Art and Computation – Summer Programming Constructs Procedures Arithmetic operations and math functions Variables (naming) Iteration Recursion Conditionals and logical operations Parameters and scoping Data structures –words (i.e.strings) –lists

BPC: Art and Computation – Summer Using Logo Computer generate images –Turtle graphics –Patterns and design 2D Animation –Animated patterns and figures DAFFIE agents –Controlling 3D DAFFIE objects –Turtle3D

BPC: Art and Computation – Summer Concepts Computers and stored programs Procedures/algorithms –Analogies to cooking/recipes Programming languages Logo history/background

BPC: Art and Computation – Summer Logo Language Logo words Verbs and nouns Commands/imperatives Inputs Functions (procedures that ouput) Numbers and arithmetic

BPC: Art and Computation – Summer Turtle graphics Using turtle graphics to draw a pattern –Interactive drawing Defining procedures using to –Saving the pattern Saving and loading the Logo workspace Using iteration to draw patterns repeat 4 [ forward 100 right 90] –Drawing polygons and patterns

BPC: Art and Computation – Summer Variables Using words to name values –“word vs :word –thing “word Using symbolic names to change the behavior of a procedure Inputs to procedures –Formal parameters and arguments –Binding –Scoping Recommend exercises to reinforce these concepts

BPC: Art and Computation – Summer Words and Lists Manipulating words (strings) –word –first, butfirst, last, butlast –Numbers as words Manipulating lists –list, sentence –first, butfirst, last, butlast –lput, lput

BPC: Art and Computation – Summer Numerical Computing Arithmetic operations Trig functions Using trig to calculate turtle movements –How do I get to point (x,y)?

BPC: Art and Computation – Summer Conditionals if if statements –Testing for conditions –Comparison operators –Logical operators

BPC: Art and Computation – Summer DAFFIE Agents – Turtle3D Turtle3D - Logo/DAFFIE interface –Control a 3D DAFFIE turtle –Turtle World –General mechanism to manipulate DAFFIE objects DAFFIE Robots

BPC: Art and Computation – Summer DAFFIE Robot Searching for food –smellfood returns an indicator of how far away the food is, 1 to 1000 Strategies –Complete traversal Traversal patterns –Random walks –Binary search

BPC: Art and Computation – Summer Hunting algorithm - Random to hunt make “steps 1 make “steps 1 while [smellfood < 1000] [findfood] while [smellfood < 1000] [findfood] print se [Found food at] pos3d print se [Found food at] pos3dend to findfood make "lastsniff smellfood make "lastsniff smellfood rt3d 90-random 180 rt3d 90-random 180 fd3d 2 fd3d 2 if smellfood < :lastsniff [ rt3d 180 fd3d 4 ] if smellfood < :lastsniff [ rt3d 180 fd3d 4 ]end

BPC: Art and Computation – Summer Hunting algorithm – Binary Search to findfood make "lastsniff smellfood make "lastsniff smellfood if (:steps = 1) [ find.direction 360] if (:steps = 1) [ find.direction 360] fd3d 2 fd3d 2 if smellfood < :lastsniff [ rt3d 180 fd3d 4 find.direction 180] if smellfood < :lastsniff [ rt3d 180 fd3d 4 find.direction 180]end

BPC: Art and Computation – Summer Hunting algorithm – Binary Search to find.direction :range if (abs :range) < 1.0 [make "food.direction heading3d stop] if (abs :range) < 1.0 [make "food.direction heading3d stop] localmake "alpha 0.25*:range localmake "alpha 0.25*:range rt3d :alpha fd3d 1 rt3d :alpha fd3d 1 localmake "smell1 smellfood localmake "smell1 smellfood rt3d -(90+:alpha) fd3d 2*sin :alpha rt3d (90-:alpha) rt3d -(90+:alpha) fd3d 2*sin :alpha rt3d (90-:alpha) localmake "smell2 smellfood localmake "smell2 smellfood if :smell1 > :smell2 [rt3d :alpha+90 fd3d 2*sin :alpha rt3d - (90-:alpha) ] if :smell1 > :smell2 [rt3d :alpha+90 fd3d 2*sin :alpha rt3d - (90-:alpha) ] pr (se [now at] heading3d :range) pr (se [now at] heading3d :range) find.direction 0.5*:range find.direction 0.5*:rangeend