In this short PA, you will be one program that prints out ascii art of a TIE fighter from Star Wars.
In the this program, you will print out a tie-fighter (an example of this spacecraft is shown above).
Name your program tie.py
.
Your program should ask the user for one number; the width of the tie fighter.
The number that your program accepts should control the width of the “arms” that extend out on each side of the tie fighter.
The height of the fins and the size of the center can remain the same size regardless of the value that the user enters.
Below are several examples of this program running with different input values provided.
Your program should match the look of the TIE fighter exactly.
You can use the differ tool to check that your output matches.
Enter TIE width:
7
|[ ]|
|[ ]|
|[ ]|
|[ /=---=\ ]|
|[ /==---==\ ]|
|[///////|== X ==|\\\\\\\]|
|[ \==---==/ ]|
|[ \=---=/ ]|
|[ ]|
|[ ]|
|[ ]|
Enter TIE width:
15
|[ ]|
|[ ]|
|[ ]|
|[ /=---=\ ]|
|[ /==---==\ ]|
|[///////////////|== X ==|\\\\\\\\\\\\\\\]|
|[ \==---==/ ]|
|[ \=---=/ ]|
|[ ]|
|[ ]|
|[ ]|
Enter TIE width:
5
|[ ]|
|[ ]|
|[ ]|
|[ /=---=\ ]|
|[ /==---==\ ]|
|[/////|== X ==|\\\\\]|
|[ \==---==/ ]|
|[ \=---=/ ]|
|[ ]|
|[ ]|
|[ ]|
Notice that the integer read in is read in on a new line, and that there is an empty space between the line where the integer is read in and the first line of the TIE fighter.
Try putitng a \n
at the end of the input prompt string to accept the integer on the next line..
Any integer number 0 or greater should be supported.
You don’t need to worry about handling negative numbers, fractions, or numbers with decimals.
You should also include a comment at the top of the code file. The comment should include your name and a short description of what the program does. Below is a template you may use:
###
### Author: Your Name Here
### Description: Describe your program with one
### or more sentences of text.
###
You should not use any python libraries or features that will not have been covered by the time this PA is due. You should be using string multiplication to get the sizing of the output correct. You are not allowed to use if-statements or for-loops. We will be checking that your code fulfills the requirements, has good style, etc. Receiving full points on all of the Gradescope test cases does not guarantee you an A.
This PA is due on Saturday, January 23rd at 7pm. Turn in the program via Gradescope. Passing all test cases does not guarantee a perfect grade. Youyr code will also be graded on style and formatting.