Skip to main content
  1. Teaching/
  2. teaching/

·3 mins

Tower Drawing

Your task for this assignment is to write a program that prints a tower. For example, here is what an output of the UT Tower might look like (note that this output does not follow the rules, so you cannot use it for your assignment!):

           ___
         _|||||_
        | /   \ |
        | |   | |
       _| \___/ |_
      |           |
      |  0  0  0  |
      |  0  0  0  |
      |  0  0  0  |
      |  0  0  0  |
      |  0  0  0  |
      |  0  0  0  |
      |  0  0  0  |
    __|           |__
 __|                 |__
|_______________________|

Your tower must be no more than 30 characters wide at its widest point, and it must be at least 20 characters tall. You must have at least one window or feature on the face of the tower. The tower must be complete (e.g. no leaving out walls or floors). You may use any characters you like for the tower, including box-drawing characters and emoji, as long as they make sense in the context of the tower.

At the beginning of the output, print out what tower you've based your drawing on. Here are some towers that you might base your drawing off of, though you are not limited to these:

  • UT Tower
  • One World Trade Center
  • Abraj Al-Bait Clock Tower
  • Ping An Finance Tower

Finally, your tower should have one blank line above and below, and at least two blank columns on the left and right in every row.

It is very important that you follow these directions exactly. One of the most important abilities when programming is to be able to implement a specification that has been given to you by someone else. If your program has a specification, you should make sure to follow it exactly[^a]. If the specification is ambiguous, you should talk to whoever wrote it to clarify. In this class, you should ask me either in-person or on Piazza.

Note: This assignment is only about printing text. You don't have to generate every letter/character with a program, or anything else complicated. You can just draw the text in an editor, copy it into python, break it up into a print statement per line, then assemble it into a program. You should test your before you submit it.

Submission

Submit a single file named Tower.py (pay attention to capitalization!) on Canvas. Your file needs to compile and run. It should also have a header with the following information (this goes in your source file, not in the program output):

# File: Tower.py
# Student: 
# Course: Intro to Programming
# 
# Date:
# Description of Program:

The description should be a short (1-3 sentence) description of what the program does. Do not describe how it's written! (Think back to HW 0 to see the difference). If you submit multiple copies, Canvas will rename them with version numbers (e.g. Tower-2.py). Don't worry about this--I will make sure to test the latest copy, and you won't be penalized for any name changes that Canvas makes.

[^a]: To see how serious people get about this in the real world, see this document, which attempts to define what specific words mean in a specification.