Lab 2 Write-Up

The task for this project was to create a building using Turtle Graphics, that could be easily replicated in varying sizes

In order to parameterize the building, I made the code using numbers, which were divisible by 5. Then, when the code created the building that I wanted, I changed the dimensions of the instructions to dx*(the multiple of 5). For example if the line said forward (15) I would rewrite it as forward(3*dx). It is important not to use the variable dx in the commands following the commands right or left.

In order to solve the problem how to orient the building, I started the function with the commands up(), goto(x0, y0), down(). This allowed me to control the orientation of the building by entering the buildings coordinates when I called the function. This also helped position the windows correctly.

After creating a building which I could replicate, I experimented with a secong building. I also experimented by tilting the buildings at an angle.

Scene 1

Scene 2

Scene 3