Fall 2015, The College of Saint Rose

Lecture 17: Introduction to Programming
Date: Friday, October 30, 2015

Agenda

• Announcements
• Studio/Lab 7: Surprise! due tonight
• Coming soon: next Studio/Lab will be using Bézier curves to define a stained-glass window
• think about how you can design a set of Prisms with Bézier profiles that would fit together into a window
• UPDATE: it's out: Studio/Lab 8: Stained Glass Window
• Also coming soon: starting to think about final projects
• Lecture 16 assignment recap
• Bézier wrapup
• Introduction to programming
• repetition
• Python's for loop
• In-class Exercise 17 - (10 lecture assignment points) due before the end of class.

Develop a model that contains a diagonal row of little red spheres (like the ones in today's class examples) from the lower left to the upper right of the image and another row from the upper left to lower right, when viewed by the default camera and image settings. Hint: the program is very similar to the class examples, but you need to translate spheres in both x and y. You can either do this with two statements inside of one loop or two separate loops.

Here's what my image looks like:

Please demonstrate your program or submit your Python model and image by email before you leave class. Email submissions should use a meaningful subject line, clearly indicating the course number and assignment name.

Due at the start of class, Wednesday, November 4.

Please submit answers to these questions either as a hard copy (typeset or handwritten are OK) or by email to terescoj AT strose.edu by the start of class. Please use a clear subject line when submitting by email (e.g., CSC 112 Lecture 17 Assignment , Joe Student). We will discuss these questions at the start of class, so no late submissions are accepted.

Create a Prism using a Bézier profile that looks sort of like a loaf of bread. Here's what I came up with.

Yours does not need to look identical. You will define a polygon with groups of 4 points defining each part of the profile as a cubic Bézier curve. (10 points)

Terminology

• computer programming
• programming language
• statement
• assignment statement
• object manipulation
• sequential execution
• repetition
• loop construct
• list

Examples