Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.

Slides:



Advertisements
Similar presentations
Physical Computing INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.
Advertisements

Creative Computing. \\ aims By the end of the session you will be able to: 1.Move objects around 2.Write simple interactive programs 3.Use the mouse position.
Algebra Tiles.
Lesson 4-1 Example Example 1 Draw an array to model the expression 4 × 5. Then write and model the commutative fact. 1.Identify the first number.
Lesson 5-1 Example Example 1 Draw an array to model the expression 12 ÷ 4. 1.Identify the divisor (the second number). This represents the number.
Two-Dimensional Arrays Chapter What is a two-dimensional array? A two-dimensional array has “rows” and “columns,” and can be thought of as a series.
Image Processing … computing with and about data, … where "data" includes the values and relative locations of the colors that make up an image.
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
1 RTL Example: Video Compression – Sum of Absolute Differences Video is a series of frames (e.g., 30 per second) Most frames similar to previous frame.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Changing Control.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Getting Behind the Project.
R-1 University of Washington Computer Programming I Lecture 17: Multidimensional Arrays © 2000 UW CSE.
Lecture 3 IAT 800. Sept 15, Fall 2006IAT 8002 Suggestions on learning to program  Spend a lot of time fiddling around with code –Programming is something.
Exponential Notation Awesome to the power of ten!.
Simplest Fractions for Whole Numbers. Look at this picture. How many parts are in each group? Yes, 4. What’s the bottom number for the fraction shown.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Adding some light to computing ….
Find the product. 1) 3 x 4 x 5 2) 8 x 4 x 3 3) 2 x 3 x 9 4) 2 x 6 x 4 5) 8 x 2 x 4 6) 7 x 5 x2 5-Minute Check.
Two –Dimensional Arrays Mrs. C. Furman Java Programming November 19, 2008.
CHAPTER: 12. Array is a collection of variables of the same data type that are referenced by a common name. An Array of 10 Elements of type double.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Multi-Dimensional Arrays Arrays that have more than one index: Example of differences between basic data types and arrays using integers: Basic integer:
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Assignment 6.
Homework 9 Due ( M & T sections ) ( W & Th sections ) at midnight Sun., 11/3 Mon., 11/4 Problems
Multidimensional Array Sample Projects. Grading Program Objective: write a program that grades multiple-choice test.
Activity Set 2.3 PREP PPTX Visual Algebra for Teachers.
1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C arrays ❏ To be able to pass arrays and array elements to functions.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 We’re underway …
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 More details and explanation …
 Functions package up computation … when do we use them? All the time.  Write some simple code to achieve a goal … 12/20/2015© 2010 Larry Snyder, CSE1.
Module 6 Lesson 15. Objective Use math drawings to partition a rectangle with square tiles, and relate to repeated addition.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Computer Science I Arrays. Parallel structures. Classwork/Homework: Build your own bouncing things.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington 2D arrays COMP 102 # T1.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Functional Abstraction Reduces Complexity.
digit x 1 digit 3 DIGIT BY 2 DIGIT Multiplying Decimals 4 digit by 3 digit
Welcome to Processing Who does not have access to digital camera?
Programming for Art: Arrays – 2D ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 16 Fall 2010.
© 2006 Pearson Addison-Wesley. All rights reserved Arrays of Greater Dimension One-dimensional arrays are linear containers. Multi-dimensional Arrays.
Introduction to Processing Dominique Thiebaut Dept. Computer Science Computer Science Dominique Thiebaut Thiebaut -- Computer Science.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Making an example of Pacman.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Lesson 5-4 Example Example 1 Draw an array to model and find 21 ÷ 3. 1.Write the answer if you know it. Otherwise, draw an array.
{ Module 4 Lesson 3 Model tiling with centimeter and inch unit squares as a strategy to measure area.
My View of Life Sketch and Wash Pencil portraits.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Frogs and Toads 4 FrogApp and FrogApplet
Developing an App CSE 120 Spring 2017
Puzzle App II CSE 120 Winter 2018
Graph Paper Programming
Fractions.
Hosted by Ms. Vaughn.
Hosted by Ms. Vaughn.
Announcements Mid-Term Exam!! Quiz 5 Again + Quiz 6 Exercise 5
Hosted by Ms. Vaughn.
Art Programs Raise Deep Questions
Announcements How’s it going? My internet/power supply?
Testing and Repetition
Multidimensional Arrays
Variables, Assignments Testing + Iteration
Lawrence Snyder University of Washington, Seattle
Hosted by Ms. Vaughn.
Hosted by Ms. Vaughn.
LCC 6310 Computation as an Expressive Medium
Announcements How to save your work? Quiz solution 5/5/2019
Buttons & Boards CSE 120 Winter 2019
Mixed Numbers Equivalent Simplest Form Comparing
Hosted by Mrs. Fowler.
Lawrence Snyder University of Washington
Presentation transcript:

Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004

10/2/2015© 2010 Larry Snyder, CSE2 The app works like the children’s toy. To move a piece, click on the one to be moved

10/2/2015© 2010 Larry Snyder, CSE3

10/2/2015© 2010 Larry Snyder, CSE4

10/2/2015© 2010 Larry Snyder, CSE5

10/2/2015© 2010 Larry Snyder, CSE6

 The tiles[ ] array is initialized with digits, but it could have been assigned in a loop  The shade[ ] array is just a series of cells … it is initialized in a loop in setup( ) 10/2/2015© 2010 Larry Snyder, CSE7

 We can now draw numbers from tiles[ ] with colors from shade[ ] 10/2/2015© 2010 Larry Snyder, CSE8

 convert from r/c ref.s to array index ref.s 10/2/2015© 2010 Larry Snyder, CSE9

10/2/2015© 2010 Larry Snyder, CSE10

 Like the birthday array, when we click on a tile, we compute the row and column as row = (mouseY - 100)/50; col = (mouseX - 100)/50;  If the present open position is at ex,wy then what are legal moves?  The row or col can change by 1 but not both  Say that as: abs(row-ex) + abs(col-wy) == 1 10/2/2015© 2010 Larry Snyder, CSE11

 And if (abs(row-ex) + abs(col-wy) == 1) then what?  Exchange tiles[ ] values  Exchange shade[ ] values … for ex,wy with row,col  An example exchange …  To exchange values of a and b int temp = a; a = b; b = temp; 10/2/2015© 2010 Larry Snyder, CSE12 Standard Technique

10/2/2015© 2010 Larry Snyder, CSE13

10/2/2015© 2010 Larry Snyder, CSE14

 Sketched the idea on paper  Started with simplest stuff  Built on previous work by adding one function or one idea at a time  Checked after every improvement 10/2/2015© 2010 Larry Snyder, CSE15