Nick deMarco
- Problem Set #1
|
Part 1
|
p1.dbn |
// a carefully chosen line
paper 50
pen 100
line 0 50 100 50
|
|
Create a program to draw a carefully chosen one line on a paper of your choice.
|
Part 2
|
![](p2a.gif) ![](p2b.gif) p2.dbn |
// This program uses one var
// as a means to control a set
// of 3 lines. capture 3 instances
// (a,b,c)
//
paper 50
pen 100
set x 50
line 0 (x-50) 100 (x+50)
line (x-50) 100 (x+50) 0
line x 0 x (x+50)
|
|
Create a program that uses one variable as a means to control a set of 3 lines. Capture 3 instances of the graphic (A,B,C).
|
Part 3
|
p3.dbn |
// This program draws a single
// filled rectangle.
//
paper 0
pen 100
repeat a 5 80
{
line a 75 a 90
}
|
|
Create a program to draw a single filled rectangle. Again, choose carefully.
|
Part 4
|
p4.dbn |
// This program draws a single
// filled triangle.
//
Paper 0
Pen 100
repeat a 0 30
{ line (22+a) (35+a) (82) (35)
}
|
|
Create a program to draw a single filled triangle. Use your good judgement.
|
Part 5
|
p5.dbn |
// single filled triangle
paper = 0
pen = 100
repeat a 20 80
{
repeat B 20 (a-1)
{
set [a B] 100
}
}
|
|
Think of all the ways you can draw a filled triangle, and choose one. Utilize the properties of the drawing method you choose, to create a single filled triangle.
|
Part 6
|
p6.dbn |
// This program evokes an emotion
// using five dots.
// {A SMILE => HAPPY}
Paper 0
set [50 50] 100
set [53 51] 100
set [47 51] 100
set [54 53] 100
set [46 53] 100
|
|
Set 5 dots on a paper of your choice. Evoke an emotion with your choice in placement of dots.
|
Part 7
|
p7.dbn |
// This program creates
// a picture of a person
// using 6 dotted lines
paper 0
// left leg
repeat a 0 5
{
set b (50 - 2*a)
set c (50 - 4*a)
set [b c] 100
}
// right leg
repeat a 0 5
{
set d (52 + 2*a)
set e (50 - 4*a)
set [d e] 100
}
// body
repeat a 1 5
{
set f (50 + 5*a)
set [51 f] 100
}
// right arm
repeat g 0 3
{
set h (53 + 3*g)
set i (65 + 4*g)
set [h i] 100
}
// left arm
repeat j 0 3
{
set k (47 - 3*j)
set l (65 + 4*j)
set [k l] 100
}
// head
repeat m 0 4
{
set n (49 + m)
set [n 75] 100
}
set [51 77] 100
|
|
Create a representational picture (i.e. something that looks like something) using just 8 (at maximum) dotted lines.
|
Part 8
|
p8.dbn |
paper 0
pen 100
repeat a 0 100
{
repeat b 0 100
{
set [a b] b
}
}
|
|
Using a nested loop, fill the entire field with the value of some calculation that can be appreciated. Do not use the Line command.
|
Part 9
|
p9.dbn |
paper 0
pen 100
repeat b 45 80
{
repeat n 1 80
{
smaller? n 50
{
set[(b-40) (n+(b-40)-1)] n
set[(b-10) (n+(b-40)-1)] n
set[(b+15) (n+(b-40))] n
}
}
}
|
|
Using a nested loop, create a stippled pattern of dots that can be enjoyed for its complexity. Do not use the Line command.
|
Part 10
|
p10.dbn |
paper = 0
pen = 100
set y 2
set z 0
set q 5
repeat x 1 9
{
set h q
set q (q+10)
set y (x*10)
set z (x*15)
repeat a y z
{
repeat B 10 (a-1)
{
set [a b] (h+5)
}
}
}
|
|
Using the Line command, and a (few) nested loop, create an image that evokes a three-dimensional feeling through shading.
|