In this PA, you will be writing multiple programs that print out ascii art of star-wars vehicles. Each of these programs shoult accept multiple values from the user which are used to adjust the size of the printout.
In this program program, you will print out a AT-AT (an example of this machine is shown above).
Name your progam atat.py
.
Your program should ask the user for three numbers; the neck length, the body height, and the leg height.
The neck length controls how long the neck of the AT-AT, made out of dashes.
The body height will control how tall the top part of the AT-AT body, above the neck.
The leg height controls the height of the legs.
Below are serveral examples of this program running with different input values provided.
Neck Length:
0
Body Height:
0
Leg Height:
0
_,.-Y | | Y-._
.-~" || | | | "-.
|______________________| _____
L______________________[---I" .-{"-.
I____________________ [__L][I_/r(=}=-P
L________________________j~ '-=c_]/=-^
\________________________]
[___________________]
I--I"~~"""~~"I--I
([]) ([])
/|..|\ /|..|\
|=}--{=| |=}--{=|
.-^--e-^-. .-^--e-^-.
Neck Length:
2
Body Height:
1
Leg Height:
3
_,.-Y | | Y-._
.-~" || | | | "-.
|______________________|
|______________________| _____
L______________________[-----I" .-{"-.
I____________________ [__L]__[I_/r(=}=-P
L________________________j~ '-=c_]/=-^
\________________________]
[___________________]
I--I"~~"""~~"I--I
|\n| |\n|
|\n| |\n|
|\n| |\n|
([]) ([])
/|..|\ /|..|\
|=}--{=| |=}--{=|
.-^--e-^-. .-^--e-^-.
Neck Length:
7
Body Height:
7
Leg Height:
5
_,.-Y | | Y-._
.-~" || | | | "-.
|______________________|
|______________________|
|______________________|
|______________________|
|______________________|
|______________________|
|______________________|
|______________________| _____
L______________________[----------I" .-{"-.
I____________________ [__L]_______[I_/r(=}=-P
L________________________j~ '-=c_]/=-^
\________________________]
[___________________]
I--I"~~"""~~"I--I
|\n| |\n|
|\n| |\n|
|\n| |\n|
|\n| |\n|
|\n| |\n|
([]) ([])
/|..|\ /|..|\
|=}--{=| |=}--{=|
.-^--e-^-. .-^--e-^-.
In this program, you will print out ascii art of the nebulon spaceship (an example of this machine is shown above).
Name your progam nebulon.py
.
Your program should ask the user for six numbers; The number of small/meduim/large layers on the bottom-front of the ship, and the widths of the front, middle, and back of the ship.
Below is a diagram showing what component of the ship each input value determines.
The Large, med, and bottom later inputs control the height of those three components. The front, middle, and back lengths control how long (wide) each of the upper components are. (Don’t worry about trying to make your ship printout match the above image. Instead, use the test cases)
Below are serveral examples of this program running with different input values provided.
Large Layers on bottom:
1
Medium Layers on bottom:
1
Small Layers on bottom:
1
Front length:
10
Middle length:
10
Back length:
10
/=----------\ /----------|
/==//////////==\\\ |===========|
|==-\\\\\\\\\\======\--======================|
\==============-----------------------------|
\=----------=/// \===========/
/-------|
\=======|
/+++++|
\-----|
\<<<|
<<<|
Large Layers on bottom:
2
Medium Layers on bottom:
2
Small Layers on bottom:
2
Front length:
20
Middle length:
23
Back length:
10
/=--------------------\ /----------|
/==////////////////////==\\\ |===========|
|==-\\\\\\\\\\\\\\\\\\\\======\--===================================|
\========================------------------------------------------|
\=--------------------=/// \===========/
/-----------------|
\=================|
/-----------------|
\=================|
/++++++++++|
\----------|
/++++++++++|
\----------|
\<<<<<<|
<<<<<<|
\<<<<<<|
<<<<<<|
Large Layers on bottom:
1
Medium Layers on bottom:
3
Small Layers on bottom:
1
Front length:
15
Middle length:
15
Back length:
20
/=---------------\ /--------------------|
/==///////////////==\\\ |=====================|
|==-\\\\\\\\\\\\\\\======\--=====================================|
\===================--------------------------------------------|
\=---------------=/// \=====================/
/------------|
\============|
/+++++++|
\-------|
/+++++++|
\-------|
/+++++++|
\-------|
\<<<<<|
<<<<<|
Notice that the length of the front section of the ship also increases the length of the bottom layers. Thus, the bottom layers need to be able to grow in width and height, depending on the values entered.
For the first three input values, you only need to support values greater than 0 and less than 10. For the three last input values, you only need to support values greater than 9 and less than 25.
The formula to determine the lengths of the lower layers is as follows:
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. We will be checking that your code fulfills the requirements, has good style, etc. 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 Tuesday, January 26th at 7pm. Turn both programs via on Gradescope. You should make sure that your final submission passes all of the test cases. Passing all test cases does not guarantee a perfect grade. Your code will also be graded on style and formatting.