Graph Paper Programming

Slides:



Advertisements
Similar presentations
SLIDE SHOW INSTRUCTIONS
Advertisements

An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
SLIDE SHOW INSTRUCTIONS This presentation is completely under your control. This lesson will show only one step at a time, to see the next step you must.
Data n easy steps to a great career day 0 Where n = 3.
Tell the robot exactly how to draw a square on the board.
Introduction to Computer Programming
Cup Robotics An Introduction to Coding, Functions, and Parameters.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
CS Unplugged Demo Lester Jackson, Sr. Program Manager.
PowerPoint Tutorial. Basic Vocabulary ► Slide - Presentation - Slide layout – ► ► ► a single page in PowerPoint all the slides for a speech all the slides.
Algorithms and Programming
AP Computer Science Principles Data Abstraction and Procedural Abstraction Curriculum Module.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
By the end of this session you should be able to...
Introduction to TouchDevelop
TA SURVEY Have the TA write their name on the board Fill out the survey at: The TA should walk out 5 minutes.
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
Structured Programming (4 Credits)
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Using MIT Scratch for Programming and Control Exercise 1 Creating movement Year 11 DTG 2012.
Progression in KS3/4 Algorithms MONDAY 30 TH NOVEMBER SUE SENTANCE.
Programming Basics - RobotC Introduction to Robotics.
PowerPoint Tutorial.
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
Egyptian Writing Hieroglyphics.
ICS 3UI - Introduction to Computer Science
Computer Programming.
Revision of Modes of Representation or Cognitive Levels
Kleene’s Theorem and NFA
Unit 3: Lesson 1 - The Need for Programming Languages
In the beginning… software
Every Day We're PROGRAMMING
UNIT 2 – LESSON 3 Encoding B&W Images.
Chapter 2 Section 8.
Accsess 2013 Creating Database.
UNIT 3 – LESSON 5 Creating Functions.
Lecture 2 Introduction to Programming
The Need for Programming Languages
Learning Objective: to be able to design programs that use sequencing.
Practice PT - Design a Digital Scene 3 days
Learning to program with Logo
Chapter 2 Section 8.
Creativity in Algorithms
Example Fill in the grid so that every row, column and box contains each of the numbers 1 to 9:
Lesson 2 Programming constructs – Algorithms – Scratch – Variables Intro.
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
Graph Paper Programming
Programming Fundamentals (750113) Ch1. Problem Solving
Creating Functions with Parameters
Theory of Computation Turing Machines.
PRESENTATION LAYOUTS This is a title slide
Programming Basics - RobotC
Computational Thinking for KS3
Hundreds board counting
Early - I can develop a sequence of instructions and run them using programmable devices or equivalent Designs a simple sequence of instructions/algorithm.
MA/CSSE 474 Theory of Computation
KS3 Mathematics A5 Functions and graphs
N6 Calculating with fractions
Chapter 6: User-Defined Functions I
What is an algorithm? Buddy Buzz Who can answer this question?
Data and Flowcharts Session
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
An Introduction to Programming with C++ Fifth Edition
Data and Flowcharts Session
Quiz: Computational Thinking
Hour of Code Code.org/lightbot
Programming Logic and Design Eighth Edition
Presentation transcript:

Graph Paper Programming

Understand how “Coding” works Main Goal Understand how “Coding” works

Objectives Understand the difficulty of translating real problems into programs Learn that ideas may feel clear to you and still be misinterpreted by a computer Interpretation is key! Realize the need for formal programming structures like loops and functions

Vocabulary Algorithm Coding Debugging Function Parameters A series of instructions on how to accomplish a task Coding Transforming actions into a symbolic language Debugging Finding and fixing problems in code Function A piece of code that can be called over and over Parameters Extra bits of information that you can pass into a function to customize it

What is a robot? Does a robot really “understand” what people say? Robots operate off of “instructions”, specific sets of things that they have been preprogrammed to do. In order to accomplish a task, a robot needs to have a series of instructions (algorithm) that it can run.

Programming key Programming language made of lines and arrows Move One Square Forward - (move forward) Move One Square Backward - (move backward) Move One Square Up - Move One Square Down - (next line) Fill-In Square with Color - (fill-in) Change to Next Color - In this instance the symbols on the right are the “program” and the words on the left are the “algorithm” piece. This means that we could write the algorithm: “Move One Square Forward, Move One Square Forward, Fill In Square With Color” And that would correspond to the program:

How can you simplify????? SAMPLE ALGORITHM PROGRAM: ALGORITHM: move one square forward, fill-in, move one square forward, move one square down Move one square backward, move one square backward fill-in, move one square forward, move one square forward, fill-in, move one square down, Move one square backward, move one square backward, Move one square forward, fill-in, move one square forward How can you simplify?????

Simplify Move right to left, then back again: Remove unnecessary symbols: (move one square backward, move one square backward) from line 2 and line 4 (See next slide to see “simplified” program)

SAMPLE ALGORITHM ALGORITHM: move one square forward, fill-in, move one square forward, move one square down Move one square backward, move one square backward fill-in, move one square forward, move one square forward, fill-in, move one square down, Move one square backward, move one square backward, Move one square forward, fill-in, move one square forward PROGRAM: Row 2 and Row 4 “abstracted”. Will now start AUTOMATICALLY where you are, instead of left to right.

It is true that there is a bit of redundancy, but it can be extremely confusing to code without it. Until a programmer is experienced, it is helpful to code in the most understandable way to make sure it works, then ABSTRACT (remove) unneeded steps later.

move one square backward, Best demonstrated with larger, more complicated drawings Look for things that repeat often What could the symbol look like to replace often repeated code like: move one square backward, move one square backward, move one square backward, move one square backward, move one square backward, move one square backward

move ONE SQUARE BackWARD, move ONE SQUARE BackWARD, move ONE SQUARE BackWARD, move ONE SQUARE BackWARD, move ONE SQUARE BackWARD, move ONE SQUARE BackWARD can be replaced with the function 6

Functions and parameters You have just discovered FUNCTIONS!!! A simple representation for a complex grouping of actions How about the number? It has a name also…. That number is called a PARAMETER!!! The parameter lets the function know how many times to move backward Look at these “functions.” What do you think they do? ( 6 ) ( 6 )

Code 7 x 7 Grid: Example on Board Use Written Algorithm From Slide 2 volunteers: * one to translate algorithm to code * one to shade grid after coding complete

Row 1: Move one square forward, Fill-in, (Move one square forward, Move one square forward, Move one square forward, Move one square forward), Fill-in, Move one square forward, Move one square down (can use function to move one square forward 4 times): , , ( 4 ) , , ,

Example: Row 2 Row 2: Move one square backward, Move one square backward, Move one square backward, Move one square backward, Move one square backward, Move one square backward .. (can use function to go backward 6 times)… Fill-in, Move one square forward, Fill-in, Move one square forward, Fill-in, Move one square forward (can use function to fill in and move forward 3 times)… Move one square forward… Fill-in, Move one square forward, Fill-in, Move one square forward, Fill-in, Move one square forward (can use function to fill in and move forward 3 times)... move one square down ( 6) , ( 3), , ( 3 ) ,

Example: row 3 Row 3: Remember, start from where you are! Fill in, Move one square backward, Fill in, Move one square backward, Fill in, Move one square backward, Fill in, Move one square backward, Fill in, Move one square backward, Fill in, Move one square backward…, Fill in…, Move one square down (can use function to fill-in and move backward 6 times: ( 6 ) , ,

Row 4 Row 4:. Fill in, Move one square forward, Fill in, Move one square forward, Fill in, Move one square forward, Fill in, Move one square forward, Fill in, Move one square forward, Fill in, Move one square forward, Fill in, Move one square down (can use function to fill-in and move forward 6 times: ( 6 ), ,

ROW 5 Row 5: (Move backward one square, Fill in, Move backward one square, Fill in, Move backward one square, Fill in, Move backward one square, Fill in, Move backward one square, Fill in, ) Move backward one square, Move one square down (can use function to move backward, fill-in 5 times: ( 5 ) , ,

Row 6 Row 6: Move one square forward, Move one square forward, (Fill in, Move one square forward, Fill in, Move one square forward, Fill in, Move one square forward), Move one square Forward, Move one square down. , , ( 3 ) , ,

Row 7 Row 7: (Move one square backward, Move one square backward, Move one square backward), Fill in, (Move one square backward, Move one square backward, Move one square backward) (can use functions to move backward three squares): ( 3 ), , ( 3)

Symbol CodE for example on board Row 1: , , ( 4 ) , , , Row 2: ( 6), ( 3), , ( 3), ROW 3: ( 6), , ROW 4: ( 6), , Row 5: ( 5), , Row 6: , , ( 3), , row 7: ( 3), , ( 3)

ASSIGNMENT PART 1: Write your name and color at the top of the page with the blank “5 x 5” grids Choose image from image pack of “5 x 5” image grids Write out COMPLETE algorithm to draw that image (no shortcuts!) Convert algorithm into a program using symbols Swap programs with another student and draw their image ON THE CORRECT GRID PART 2: Draw an original more complex image on “6 x 6” or “7 x 7” grid (shade squares to create image) Write an algorithm and program for that more complex image (you may use color) Add “functions” and “parameters” to make program more simple (min. 2 ) Swap your complex program and draw image ON THE CORRECT GRID

Programming key Programming language made of lines and arrows Move One Square Forward Move One Square Backward Move One Square Up Move One Square Down Fill-In Square with Color Change to Next Color