Catherine Foo - Problem Set #2
 
Part 1
p1.dbn
// type program here
paper 100
// a nice, solid black - for a change.

Choose a single shade of a paper and render that shade.
 
Part 2
p2.dbn
// ps2-2
// a really long sequence. it never gets totally black,
// nor does it ever get totally white.
// you have to watch the whole thing to get a solid black color.
repeat a 500 800
{
   paper (a/10)
   repeat b 100 a
   {
      paper (b/10)
   }
}
paper 100

Create a sequence of shaded papers using the Repeat command as a short animation of brightness. For example
Repeat a 0 100
{
Paper a
}

 
Part 3
p3.dbn
// ps2-3
// almost a ti ta ti ta rhythm.
repeat b 0 10
{
   repeat a 0 50
   {
      paper a
   }
   repeat a 0 50
   {
      paper 50
   }
   repeat a 50 100
   {
      paper a
   }
   repeat a 0 50
   {
      paper 100
   }
   repeat a 100 70
   {
      paper a
   }
   repeat a 0 50
   {
      paper 70
   }
   repeat a 70 0
   {
      paper a
   }
   repeat a 0 80
   {
      paper 0
   }
}

Create an animation of a sequence of shaded papers that evokes a sense of rhythm.
 
Part 4
p4.dbn
// i wish i had more gray colors and less speckling..
//
repeat b 0 10
{
repeat a 800 2500
{
paper (a/50)
}
repeat a 2500 800
{
paper (a/50)
}
}

Create an animation of a sequence of shaded papers that evokes a tranquil, sleepy image.
 
Part 5
p5.dbn
// ps 2-5
// dark to light
// slow to fast
repeat b 100 50
{
   repeat a 0 10
   {
      paper b
   }
}
repeat b 80 30
{
   repeat a 0 5
   {
      paper b
   }
}
repeat b 60 0
{
   repeat a 0 2
   {
      paper b
   }
}

Create an animation of a sequence of shaded papers that evokes a gradually increasing/heightening feeling.
 
Part 6
p6.dbn
//this line tosses around the box, then decides
//that he likes being home.
paper 50
pen 100 
repeat b 0 10
{
repeat a 0 100
{
paper (((100-a)*b)/100+30)
pen a
line a (100+(b*a/10)) (100-a) (b*(a/10))
}
repeat a 100 0
{
paper ((b*(100-a))/100+30)
pen a
line 100 (a+(b*a/10)) 0 (100-a+(b*a/10))
}
}


Add a single line to the sequence, and let it fly in time. For instance
Repeat a 0 100
{
Paper 0
Line a 0 a 100
}

 
Part 7
p7.dbn
// ps 2-7
// one steadily paces around the perimeter,
// the other hops from corner to corner.
// if you keep watching this long enough, 
// the lines will disappear into fog.
set z 100
pen 0
repeat b 0 20
{
set z (100-b*5)
   repeat a (-100) (-50)
   {
      paper z
      line (a*a*a*a/1000000) (a*a/100) (a*a*a*a/1000000+10) (a*a/100)
      line ((a+100)*2) 100 (2*(a+100)) 90
   }
   repeat a (-50) 0
   {
      paper z
      line (a*a*a*a/1000000) (a*a/100) (a*a*a*a/1000000+10) (a*a/100)
      line 100 ((0-a)*2) 100 (2*(0-a)-10)
   }
   repeat a 0 50
   {
      paper z
      line (a*a*a*a/1000000) (a*a/100) (a*a*a*a/1000000+10) (a*a/100)
      line (100-a*2) 0 (100-2*a) 10
   }
   repeat a 50 100
   {
      paper z
      line (a*a*a*a/1000000) (a*a/100) (a*a*a*a/1000000+10) (a*a/100)
      line 0 (2*(a-50)) 0 (2*(a-50)-10)
   }
}

Add another line and let two lines fly in contrasting styles.
 
Part 8
p8.dbn
// ps2-8
// ps 2-8
// close call
set p 90
set j 0
set k 50
paper p
repeat b 0 5
{
   repeat a 0 90
   {
      pen j
      line 30 (100-(a*a)/81) 30 (100-(a*a/81)+2)
      pen k
      line (a*a/90) 45 ((a*a/90)+10) 45
      paper p
   }
   repeat a 90 0
   {
      pen j
      line 30 (100-(a*a/81)) 30 (100-(a*a/81)+2)
      pen k
      line (a*a/90) 45 ((a*a/90)+10) 45
      paper p
   }
}

Let two lines fly in cooperative styles.
 
Part 9
p9.dbn
// comments on Jumaane's Part 1:
//
// a nice, centered diagonal line. very symmetrical.
// missing a paper setting. what color paper does this line live in?
// the .gif appears to be 0 - is that intentional?
// 
// catfoo
//
// my version of your code - nothing changed.
paper 0
line 25 25 75 75

Using Part 1 of Problem Set 1, you are asked to comment and improve on a colleague's work. The person you will choose is determined by your order in the pulldown menu of the main page. For example, Ben should comment on Bruce, Bruce on Nick, and all the way down to Hoeteck commenting on Ben (wrapped around). We don't have a form mechanism setup, so for now just put it inside your DBN buffer as a comment, and include a modified version of your colleague's program that reflects your suggestions.
 
Part 10
p10.dbn
// comments on jumaane's part 10:
//
// wow! this looks beautiful in motion.
// it begins with a sharp black stroke, almost resembling
// an ink stroke, then the bottom half of the 'leaf' appears
// slowly, while lightening the darkness.
//
// the code is wonderfully compact as well.
// was this carefully planned out, or was it a delightful accident?
//
// catfoo
//
// no changes made to the code below.
Repeat A 0 100
{
  Pen A
  Line A ((A*A)/100) A A
  Repeat B 0 100
    {
      Pen B
      Line A A ((B*B)/100) B
    }
}

Do the same as above for Part 10 of Problem Set 1.