Lecture 14-Loops - CS1110, 20 Oct. 2009, Lec 14 Elementary...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CS1110, 20 Oct. 2009, Lec 14 Elementary graphics; intro to loops and for-loops Reading: Sec. 2.3.8 and chapter 7 on loops. The lectures on the ProgramLive CD can be a big help. A5 is out: graphics, loops, recursion. Due Sat. Oct 30th. Talks on Thursday Oct 21: Adaptive Drama Management: Bringing Machine Learning to Interactive Entertainment 4:15pm, Upson B17 (computer science, game design, social psychology) Computational Advertising , 7pm, Phillips 203 (intersection of computer science and econ) Prelim 2: Tu Nov 9 th , 7:30-9pm. Conflicts? Submit CMS "assignment" "P2 conflicts" by Oct 26 th . Have your iClicker out.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Graphical User Interfaces (GUIs): graphics. A JFrame, with a "panel" on which you can draw A “panel” in which you can draw On the panel, each pair (x,y) indicates a “pixel” or picture element. For Assignment 5 , you need to understand that: x-coordinates increase rightward y-coordinates increase downward. (0,0) (1,0) (2,0) … (0,1) (1,1) (2,1) … (0,2) (1,2) (2,2) …
Background image of page 2
3 In A5, write methods to draw shapes and spirals, and draw things using recursive procedures. Assignment A5: drawing with a Turtle We'll use ACM's GraphicsProgram, which supplies a "GTurtle": point (x, y): where the “Turtle” is angle: the direction the Turtle faces a pen color whether the pen is up or down Class GTurtle has methods for moving a GTurtle around, drawing as it goes. Draw equilateral triangle with side lengths 30; turtle t ending up at starting point and facing the same direction: t.forward(30); t.left(120); t.forward(30); t.left(120); t.forward(30); t.left(120); 0 degrees 90 degrees 180 degrees 270 degrees
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 From recursion to loops: doing things repeatedly We write programs to make computers do things. We often want to make them do things
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

Lecture 14-Loops - CS1110, 20 Oct. 2009, Lec 14 Elementary...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online