lab4

Lab4 Write-up

Task:

The task for this project was to create a program, which would take individual characters and draw the corresponding shapes. There were about 10 designated commands, each of which corresponded to a letter. The program takes the command, and performs the appropriate action.

Interface and Descripton of Programs

The user interface is not perfect, but it gets the job done. The place where I think users would have the biggest problem is when entering the file name. The file name must end with the suffix "-.txt ". For example, the file name "drawing1 " would not record the string. However, if the file were named "drawing1.txt " it would record the string. Other than that, the list of available letters and the corresponding actions comes up each time the user is asked to enter a command, so that they know what options they have.

The follow program works by taking the string entered by the user and drawing the shapes as defined by each character in the drawShape function. It also writes the entire string into a file named by the user, by using the raw_input variable to name the file.

The linearC program does the same thing, only it uses the raw_input variable to read a file, and then draw draw the corresponding shapes.

The koch program sets four variables as defined on the homework assignment. It uses the "replace()" function so that the rule variable is plugged in whenever there is an "f" in the base variable. The resulting string draws the snowflake. The complexity variable determines the number of times which this process occurs, and as a result, how complex the snowflake is.

SceneA

String Used:ubbbbbbbbbbbbbbbbbbbbbbdffffffffbbbblllllllllffffflrrfrfrfrfrfrfrfulllffffrrrrfffllrrrrlfffffffffflllrrrrrrfrrrrllllllllrfffffbbbbbdfffffffbbblllrrrrrrffffffbbbbbbrrrllllllfffffbbbbbbbbbfffflllrrrrrrfffffffurrrllllllfffffffffflllffffffrrrfffdbbbbbbrrrfffffffrrrllllllffffffrrrllllllffflllfff

SceneB

String Used:ubbbbbbbbbbbbbbbbbbbbllffbbdffrrrrrffffffflllffbbbbuffffffdfffffbbbbbllrlrffffflflflflflflflffurrrrrrrrfffffflllfffbbrfbfdfrfrfrfrfrfrfrfrfblrrbrbrbrbrbrbrbrb

SceneC

String Used:fllfrrrrfllfllfllfrrrrfllfrrrrfllfrrrrfllfllfllfrrrrfllfrrrrfllfrrrrfllfllfllfrrrrfllfrrrrfllfrrrrfllfllfllfrrrrfllfrrrrfllfrrrrfllfllfllfrrrrfllfrrrrfllfrrrrfllfllfllfrrrrfllfrrrr