Skip to main content

CSC 151.01, Class 45: Files in Scheme

Overview

  • Preliminaries
    • Notes and news
    • Upcoming work
    • Extra credit
    • Questions
  • Lab
  • Quick debrief
  • Project work time

News / Etc.

  • Sit with project partners!
  • Plan to get random partners tomorrow.
  • We’ll try to split class between lab work and project work.
  • Welcome to any admitted students who are here!

Upcoming Work

  • Lab writeup: Exercise 4 (it’s class 45)
    • Title your email CSC 151.01 Writeup for Class 45 (YOUR FULL NAMES).
  • Reading for Tuesday: Analyzing Procedures
  • Project Proposals due TONIGHT (sketches due tomorrow).
    • Make sure to describe the underlying design goals.
    • Make sure to indicate the three techniques you will use.
    • Make sure to explain how you know you will get 1000 different images.
  • Projects due next Tuesday (not tomorrow).

Extra credit (Academic/Artistic)

  • CS Table Tuesday, noon: Algorithm [sic] Accountability
    • Readings outside Charlie’s office.
  • CS Extras Thursday, 4:15pm: Gadfly

Extra credit (Peer)

  • AAA hosts Kit Yan performing Queer Heartache, Wednesday, Harris, 7pm.
    • Lots of money spent. Make it worth the money by attending.
  • Next home baseball game: May 7 (Senior Day)

Extra credit (Misc)

  • May 4 town hall on belonging. 11am, May 4, JRC 101

Other good things to do

  • Dag Field Day, Saturday, April 29, noon-5pm, in the Club Athletic Field.

Questions

How can I make sure that I have 1000 unique images?
Simple option: Pick three aspects of your project that can have ten different values (e.g., number of shapes you draw, number of edges on a polygon, which color to use, number of levels of recursion, which of ten different turtle procedures to use). Use the hundreds digit for one of those aspects, the tens digit for another, and the ones digit for a third.
More complex option: Pick multiple aspects of your project that can have different values. Take the remainder of n when divided by various relatively prime numbers to choose. E.g., if you mod by 7, 11, 13 you have 71113=1001 different images. You could also use 3, 4, 5, 7, and 11, which gives 345711=4620 different images.
More complex option: Have ten things that can be off or on. Somehow convert n into ten off/on settings. 2^10 = 1024.
Dangerous option: n is the number of levels of recursion in a fractal-like structure.
Unacceptable option: n is the number of sides in a polygon. [Once n is large enough, it’s nearly impossible to tell things apart.)
Unacceptable option (but can be used in conjunction with one of the other options): Seed the random number generator with n.
So I could do a Warhol-esque thing where I have ten choices for each
of the four squares?
That sounds like you’re using only one technique. But otherwise, yes. But what are you trying to achieve, other than something trite?
If I do that, will Warhol’s estate sue?
Historical evidence suggests not.
Suppose I want to select between 14 different colors. Any suggestion
of how to do so easily?
Make a vector of those colors. Use (vector-ref colors (remainder n 14))
More generally: (vector-ref colors (remainder n (length colors)))
Do you really want the brush scaled?
Yes.
Do you really want color blends scaled and stretched?
Yes.
Do you plan to bring in a design critic?
Yes.
Do you expect the 6P’s for any procedure we write?
At least four.
Do you expect clear and concise code?
Certainly.
When do you expect to get our proposals reviewed?
Before you graduate?
Whoops! There are prospectives here. I’ll try for Wednesday.
Can we ask the prospectives questions?
Just in small groups. I’d like to make sure that there’s time for you to work on your projects.

Lab

How do you know that sum-of-file worked?

The eof object is the file version of the null you hit at the end of a list. [Thanks to RN for the idea.]

Debrief

Writeup

Write up exercise 4 from the lab on files.
Send your solution to csc151-01-grader@grinnell.edu.

Title your email CSC 151.01 Writeup for Class 45 (YOUR FULL NAMES).

Project work time