proj 3 writeup
Skip to end of metadata
Go to start of metadata

#Pratap Luitel

#CS 151 SP ?11 Proj 3

This was my code in project 2 for making windows in miller library. I used loop twice for the same purpose back then.

 After learning nested looping, the same work was done by this code. It is fairly simpler and shorter.

4.I then scaled my colby scene from last project and drew it in 3 different locations at a same time. After scaling the entire scene, my new function takes x,y as the bottom left corner of the scene and a scaling factor.

5.I then made a new function that incorporated my colby scene with a frame. I then used the function multiple times to create different wall scenes as seen above. The new function took x,y as the bottom left of the scene, two sets of colors in tuples for the frame color.


I then modified my second colby scene so that it could take arguments from command line and draw a scene accordingly. In my function, user could input the x,y coordinate as the bottom left coordinate, a scaling factor and the option of daylight setting or night setting in the backdrop.

If the user enters less than 4 commands, then my program will not run. Instead it will display the list of required commands so that the user can input accordingly.


I have basically used extensions throughout my project. In the figure above, I have framed 3 different colby scenes. Each scene is scalable, and its frame color is changeable. Furthermore, the second and third pictures are drawn from a same command [scene2(x,y, color for outer frame,color for inner frame,1 or 2 for the background setting)] with different arguments. In the second, the background is selected as 1, indicating a daylight. In the third, a parameter 2 is passed to draw a night scene as can be noticed in the code snippet below.

For my task 6, I had used more 4 command line arguments which controlled the x,y position of the scene, scale factor, and the background setting.

I used range function in a nested loop to make the windows in the buildings.

I then used simple shapes like line, circle and rectangle, to make a wall painting which is posted below.

From this project, I learned efficient programming. Using parameters like "fill" and "color" made my functions(which i defined) shorter and easier, and programming less prone to errors.