Tues/Thurs 4-5:30 pm in Park 336
Tues/Thurs 5:30-6:30 pm in Park 231
Tues/Thurs 1-4 pm by arrangement in Park 250
7 Assignments | (8% each) 56% | |
Exam 1 | 20% | |
Exam 2 | 24% | |
Total |
cs.brynmawr.edu/Courses/cs110/fall2012/section002/ |
moodle.brynmawr.edu/course/view.php?id=312 |
Computer science is no more about computers than astronomy is about telescopes.
Edsger Dijkstra
A collection of human and machine readable statements that can be translated to instructions executable by a computing device.
A text file. For example...
# Mouse orbiter from Processing import * size(500, 300) background(255) # Orbit angle state variable angle = 0 def draw(o, e): global angle background(255) fill(0, 0, 255) ...
from Processing import *
from Processing import * window( width, height )
line( x1, y1, x2, y2 ) triangle( x1, y1, x2, y2, x3, y3 ) quad( x1, y1, x2, y2, x3, y3, x4, y4 ) rect( x, y, width, height ) ellipse( x, y, width, height )
Colors can be composed of four elements:
...all are assigned values in the range [0..255]
Byte from 8 Bits - Click bit to flip
Shape fill color, line color and line thickness can be set.
|
Shape attributes are set *before* a shape is painted, as if the paintbrush properties are selected.
Use the fill() command to set the fill color of all shapes.
Use the stroke() command to set the stroke color of all shapes.
from Processing import * window(200, 200) background(255) fill(255, 0, 0) stroke(0, 255, 0) strokeWeight(5) rect(50, 50, 100, 100) |
fill(red, green, blue, alpha) fill(red, green, blue) fill(gray, alpha) fill(gray) noFill()
stroke(red, green, blue, alpha) stroke(red, green, blue) stroke(gray, alpha) stroke(gray) noStroke()
Fills the entire sketch with the specified color
background(red, green, blue, alpha) background(red, green, blue) background(gray, alpha) background(gray)
Defines how the first two arguments of rect() and ellipse() are interpreted.
from Processing import * window(225, 125) background(255) # Default setting rectMode(CORNER) fill(255, 0, 0) rect(50, 50, 50, 50) rectMode(CENTER) fill(0, 255, 0) rect(50, 50, 50, 50) |
from Processing import * window(225, 125) background(255) ellipseMode(CORNER) fill(255, 0, 0) ellipse(150, 50, 50, 50) # Default setting ellipseMode(CENTER) fill(0, 255, 0) ellipse(150, 50, 50, 50) |
We will use Dropbox for assignment submissions
Sign up at http://www.dropbox.com
/
#