Due Friday, December 9th at Midnight.
At the conclusion of this programming assignment, participants should be able to:
Before starting this programming assignment, participants should be able to:
Content used in this assignment is based upon information in the following sources:
Write a program (ascii_art_text.py) to generate files containing words represented by ASCII art. I have used this website to generate 26 files each containing ASCII art for a capital letter of the alphabet (there are 26 letters in the alphabet). For this assignment, you will need to download a zip file containing these 26 files: stars.zip. Unzip this stars.zip into a folder called stars. Take a look at A.txt, pretty cool huh? Check out the different fonts available from the website I used, they are awesome!
The program should perform the following steps:
os
module's function called listdir(<string path to directory>)
that returns a list of the files in a particular directory. letter_art
, of key:value pairs where each key is a letter string and each value is a list of strings representing the lines of the corresponding letter's ASCII art. For example, the key "A" maps to the list of strings representing the lines in A.txt. Recall: <file object>.readlines()
returns a list of string lines in a <file object>
. letter_art
such that the ASCII art is composed of the same letter the ASCII art represents. For example, letter_art["A"]
should store the ASCII art for A made of "A"s and "a"s. For an example, please see the output below.word
.word
to all uppercase.word
, write the corresponding ASCII art letter (from the letter_art
dictionary) horizontally to an output file word_art.txt
. Place a space line between ASCII art letters.Note: Your python source file, ascii_art_text.py, should be in the same folder (e.g. PA8) containing the stars folder. So the directory structure looks like the following:
+--PA8
| | ascii_art_text.py
| +--stars
| | | A.txt
| | | B.txt
...
| | | Z.txt
Example output file if the user enters "abc":
AAA BBBBBBBBBBBBBBBBB CCCCCCCCCCCCC
AaaaA BbbbbbbbbbbbbbbbbB CCCccccccccccccC
AaaaaaA BbbbbbbBBBBBBbbbbbB CCcccccccccccccccC
AaaaaaaaA BBbbbbbB BbbbbbB CcccccCCCCCCCCccccC
AaaaaaaaaaA BbbbbB BbbbbbB CcccccC CCCCCC
AaaaaaAaaaaaA BbbbbB BbbbbbB CcccccC
AaaaaaA AaaaaaA BbbbbBBBBBBbbbbbB CcccccC
AaaaaaA AaaaaaA BbbbbbbbbbbbbbBB CcccccC
AaaaaaA AaaaaaA BbbbbBBBBBBbbbbbB CcccccC
AaaaaaAAAAAAAAAaaaaaA BbbbbB BbbbbbB CcccccC
AaaaaaaaaaaaaaaaaaaaaaA BbbbbB BbbbbbB CcccccC
AaaaaaAAAAAAAAAAAAAaaaaaA BbbbbB BbbbbbB CcccccC CCCCCC
AaaaaaA AaaaaaA BBbbbbbBBBBBBbbbbbbB CcccccCCCCCCCCccccC
AaaaaaA AaaaaaA BbbbbbbbbbbbbbbbbbB CCcccccccccccccccC
AaaaaaA AaaaaaA BbbbbbbbbbbbbbbbbB CCCccccccccccccC
AAAAAAA AAAAAAA BBBBBBBBBBBBBBBBB CCCCCCCCCCCCC
<your last name>_pa8.zip
by the due date and time.This assignment is worth 50 bonus. Your assignment will be evaluated based on a successful compilation and adherence to the program requirements. We will grade according to the following criteria:
letter_art
dictionary.word_art.txt
.