{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 14-Loops

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

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

View Full Document Right Arrow Icon
1 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 . 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) … 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);
Background image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}