# Pages CS 151 Computational Thinking Fall 2012 Assignment 1 Tim Concannon Alex Swanson Page History

## Key

• This line was added.
• This line was removed.
• Formatting was changed.
Comment: Migrated to Confluence 4.0

### TASKS:

Task 1:

Tim (director): Instructions were as follows: "Draw a star inside a circle."

Alex (artist): Successfully drew the desired shape

Task 2:

Alex (director): Instructions were as follows: "Draw an apple. The apple has a stem and a bite mark on the left side."

Further instructions: "The bite mark has three teeth imprints."

Tim (artist): Succesfully drew the desired shape

Task 3:

Meaning of terms:

Starting direction: east/right

1 angular unit = 60 degrees

1 unit = one square on paper (100 python units)

Pen down

Turn left

Turn left

Forward one

Turn left

Turn left

Forward one

Turn left

Turn left

Forward one

Task 4:

Meaning of terms:

Starting direction: east/right

1 angular unit = 60 degrees

1 unit = one square on paper (100 python units)

Pen down

Forward one

Forward one

Turn right

Forward one

Turn right

Turn right

Forward one

Forward one

Turn right

Forward one

Turn right

Turn right

Task 5:

Meaning of terms:

Starting direction: east/right

1 angular unit = 60 degrees

1 unit = one square on paper (100 python units)

ShapeC

• will be a triangle and parallelogram connected to each other to form a “3-D” shape.

Label: ShapeC

Pen down

Execute list ShapeA

Pen up

Turn left

Turn left

Forward one

Turn right

Turn right

Pen down

Execute list ShapeB

Task 6:

ShapeD

• will be like ShapeB with variable “A” representing unit length.

Label: ShapeD

Pen down

Forward A

Turn right

Forward B

Turn right

Turn right

Forward A

Turn right

Forward B

Turn right

Turn right

Label: ShapeE

Pen down

A=2

B=1

Execute list ShapeD

A=4

B=2

Execute list ShapeD

A=6

B=3

Execute list ShapeD

### Write Up:

Write Up Q#1: Yes, the “artist” drew the picture I expected.  This occurred because the shape I described was a combination of two simple shapes that most people are familiar with.

Write Up Q#2: By asking the “artist” to draw an apple, I assumed that he was familiar with what the fruit looked like. He also had to make an assumption as to how far I wanted the bite marks to go into the apple.  After seeing the final result, I felt that enough information was conveyed and that the drawing looked as I expected it to.

Write Up Q#3: In the first two instruction sets there was much more room for flexibility and ambiguity because a human can use its memory and creativity to draw the object that they have been asked to create. A computer, however, runs strictly on what you command it to do. Therefore there is no room for flexibility.

Write Up Q#4: The only difference was in part 3, the artist was instructed to create a simple triangle with equal sides. In Part 4, more instructions were needed to create a more complex shape, a parallelogram, where two sides are equal in length with each other but the top and bottom sides are longer than the left and right sides. The more complex the shape, the more commands are needed.

Write Up Q#5: By being able to define a set of commands and label it with a simple name as shapeC, we were able to drastically cut down on the number of commands needed to execute the shape that was instructed. By cutting down the number of commands, we decreased the margin for error and time it took to write the code.

Write Up Q#6: If a list of commands were set to execute itself, we believe the shape would continuously repeat and draw over itself. There would be no end once the set of commands were executed.

Write Up Q#7: In task 3, we used a simple set of commands to create a singular triangle. If we were to use variables in our set of commands, there would be an infinite amount of triangles of different sizes we could create.

Write Up Q#8: If shape D were changed, we would not need to change shape E because in the set of commands, shape E calls upon how we defined shape D. Any change in shape D would be depicted in its definition and therefore the change would be present when shape E called upon the definition of shape D.

Write Up Q#9: The most challenging aspect for us was getting the right syntax and commands in the TextWrangler application and then importing our set of commands from a TextWrangler file into python.

### Extension:

We decided to tackle extension question #1. This is how it turned out.