SLIDE 1IS146 - Spring 2005 Computation: Programmability Prof. Marc Davis & Prof. Peter Lyman UC Berkeley SIMS Tuesday and Thursday 2:00 pm – 3:30 pm Spring IS146: Foundations of New Media
SLIDE 2IS146 - Spring 2005 Lecture Overview Assignment Check In –Assignment 3: Documenting Artifact Usage Review of Last Time –Computation: Programming Concepts Today –Computation: Programmability Preview of Next Time –Computational Media
SLIDE 3IS146 - Spring 2005 Lecture Overview Assignment Check In –Assignment 3: Documenting Artifact Usage Review of Last Time –Computation: Programming Concepts Today –Computation: Programmability Preview of Next Time –Computational Media
SLIDE 4IS146 - Spring 2005 Lecture Overview Assignment Check In –Assignment 3: Documenting Artifact Usage Review of Last Time –Computation: Programming Concepts Today –Computation: Programmability Preview of Next Time –Computational Media
SLIDE 5IS146 - Spring 2005 Algorithms and Programming Algorithm –A step-by-step description of a procedure to achieve a desired result Programming –Primitives –Means of combination –Means of abstraction
SLIDE 6IS146 - Spring 2005 From Algorithms to Programs Algorithm –A step-by-step description of a procedure to achieve a desired result –How can we walk a square? Walk forward Turn Walk forward Turn Walk forward Turn Walk forward
SLIDE 7IS146 - Spring 2005 LOGO Square Example to square –forward 50 –right 90 –forward 50 –right 90 –forward 50 –right 90 –forward 50 –end
SLIDE 8IS146 - Spring 2005 LOGO Square Example to square –params [size] –forward :size –right 90 –forward :size –right 90 –forward :size –right 90 –forward :size –end
SLIDE 9IS146 - Spring 2005 LOGO Window Example to window –params [size] –square :size –end
SLIDE 10IS146 - Spring 2005 LOGO Window Example to window –params [size] –repeat 4 [square :size] –end
SLIDE 11IS146 - Spring 2005 LOGO Window Example to window –params [size] –make squaresize (:size/2) –repeat 4 [square :squaresize] –end
SLIDE 12IS146 - Spring 2005 LOGO Square Example to square –params [size] –forward :size –right 90 –forward :size –right 90 –forward :size –right 90 –forward :size –end
SLIDE 13IS146 - Spring 2005 LOGO Square Example to square –params [size] –forward :size –right 90 –forward :size –right 90 –forward :size –right 90 –forward :size –end
SLIDE 14IS146 - Spring 2005 LOGO Square Example to square –params [size] –forward :size –right 90 –forward :size –right 90 –forward :size –right 90 –forward :size –end
SLIDE 15IS146 - Spring 2005 LOGO Square Example to square –params [size] –forward :size –right 90 –forward :size –right 90 –forward :size –right 90 –forward :size –end
SLIDE 16IS146 - Spring 2005 LOGO Polygon Example to poly –params [sides length] –repeat :sides [forward :length right (360/:sides)] –end
SLIDE 17IS146 - Spring 2005 Lecture Overview Assignment Check In –Assignment 3: Documenting Artifact Usage Review of Last Time –Computation: Programming Concepts Today –Computation: Programmability Preview of Next Time –Computational Media
SLIDE 18IS146 - Spring 2005 Programming Concepts Basic programming constructs –Parameters –Loops –Procedural abstraction –Subroutines –Conditionals
SLIDE 19IS146 - Spring 2005 Making a “C” to c –params [height] –make halfheight :height/2 –left 90 –forward :height –right 90 –forward :halfheight –right 180 –forward :halfheight –left 90 –forward :height –left 90 –forward :halfheight –end
SLIDE 20IS146 - Spring 2005 Making an “A” to a –params [height] –make halfheight :height/2 –left 90 –forward :height –right 90 –forward :halfheight –right 90 –forward :halfheight –right 90 –forward :halfheight –right 180 –forward :halfheight –right 90 –forward :halfheight –left 90 –end
SLIDE 21IS146 - Spring 2005 Making an “M” to m –params [height] –make diagonal (:height/2)*7/5 –left 90 –forward :height –right 135 –forward :diagonal –left 90 –forward :diagonal –right 135 –forward :height –left 90 –end
SLIDE 22IS146 - Spring 2005 Making an “R” to r –params [height] –make halfheight :height/2 –make diagonal :halfheight*7/5 –left 90 –forward :height –right 90 –forward :halfheight –right 90 –forward :halfheight –right 90 –forward :halfheight –left 135 –forward :diagonal –left 45 –end
SLIDE 23IS146 - Spring 2005 Making a “space” to space –params [length] –penup –forward :length –pendown –end
SLIDE 24IS146 - Spring 2005 Making “MARC” to marc –params [height kerning] –m :height –space :kerning –a :height –space :kerning –r :height –space :kerning –c :height –end
SLIDE 25IS146 - Spring 2005 Making “hopback” to hopback –params [length] –penup –back :length –pendown –end
SLIDE 26IS146 - Spring 2005 Making a Circle of “MARC” to marccircle –params [letterheight letterkerning] –make marcnamewidth ((:letterheight*5/2)+(3*:letterkerning)) –repeat 360/:letterheight –[marc :letterheight :letterkerning –hopback :marcnamewidth –right :letterheight –] –end
SLIDE 27IS146 - Spring 2005 Conditionally Making “MARC” Circles to marccirclecond –params [letterheight letterkerning circletightness] –make marcnamewidth ((:letterheight*5/2)+(3*:letterkerning)) –ifelse (:circletightness=0) –[make rotation :letterheight] –[make rotation :letterkerning] –repeat 360/:rotation [marc :letterheight :letterkerning –hopback :marcnamewidth –right :rotation –] –end
SLIDE 28IS146 - Spring 2005 Making a Square of “MARC” to marcsquare –params [letterheight letterkerning] –make marcnamewidth ((:letterheight*5/2)+(3*:letterkerning)) –repeat :marcnamewidth/:letterheight –[marc :letterheight :letterkerning –hopback :marcnamewidth –left 90 –penup –forward :letterheight –right 90 –pendown –] –end
SLIDE 29IS146 - Spring 2005 Lecture Overview Assignment Check In –Assignment 3: Documenting Artifact Usage Review of Last Time –Computation: Programming Concepts Today –Computation: Programmability Preview of Next Time –Computational Media
SLIDE 30IS146 - Spring 2005 Andrea Brown on Hillis Hillis says that “Learning a programming language is not nearly as difficult as learning a natural human language.” Do you think that if humans had difficulty comprehending natural language that their ability to learn programming language would be affected?
SLIDE 31IS146 - Spring 2005 Andrea Brown on Hillis Hillis mentions that the “most successful computers … are generally regarded by computer designers as having poorly designed instruction sets.” Why is that? If computers are meant to mimic the complexity of humans why don’t “successful computers” have elaborate instruction sets?
SLIDE 32IS146 - Spring 2005 Lecture Overview Assignment Check In –Assignment 3: Documenting Artifact Usage Review of Last Time –Computation: Programming Concepts Today –Computation: Programmability Preview of Next Time –Computational Media
SLIDE 33IS146 - Spring 2005 Readings for Next Time Walter Benjamin. The Work of Art in the Age of Mechanical Reproduction. In: Illuminations, edited by Walter Benjamin, New York: Schocken Books, 1985, p –Discussion Questions Steven Lybeck Lev Manovich. The Language of New Media, Cambridge, Massachusetts: The MIT Press, 2001, p –Discussion Questions Mark Martell