CSc 110: Robot

This assignment should be written in the python programming language. You should only use python features that we have discussed up to this point. If you have questions about whether or not a particular feature can/should be used, ask the instructors! You may use any python version 3.0 or newer.

All of your programming should be well-formatted and easy for the graders to read and comprehend. Each program file should have a header comment at the top that has the following format:

#
# Author: Student Name
# Description:
#    A short description of what this program does!
# 

If any part of your scripts are particularly complex, you should put documentation comments above those lines of code.

Robot

You will be writing a program that prints out a robot to the python console. However, the program will not always print out the same exact robot. The size of the robot will be configurable based on a few values that you read in from the command-line. At the beginning of your program, you should read in three separate values. One for the rocket height, one for the torso height, and one for the leg length. This should happen like so:

Enter rocket-launcher height: ?
Enter torso height: ?
Enter leg length: ?

These variables will correspond to the heights of the rocket-launcher, torso, and legs of the robot (respectively). After reading in these values, the program will print out a robot based on these three sizes.

Below is what the robot will look like if all three values are 0 (thus, the smallest possible robot):

Enter rocket-launcher height: 0
Enter torso height: 0
Enter leg length: 0

     ____          ____
    |    | .----. |    |
    |    |/\_||_/\|    |
    `----' / __ \ `----'
   __/ |#|/\/__\/\|#| \__
  / \_/|_|| |/\| ||_|\_/ \ 
 |_\/    o\=----=/o    \/_|
 | |   ___|======|___   | |
//\\  / |O|======|O| \  //\\ 
|\/|  \_+/        \+_/  |\/|
\__/  _|||        |||_  \__/
   __|\_/|__    __|\_/|__
  /___n_n___\  /___n_n___\

If the three constants are changed to 1, 1, 1 (respectively) then the program will print:

Enter rocket-launcher height: 1
Enter torso height: 1
Enter leg length: 1

     ____          ____
    |oooo|        |oooo|
    |    | .----. |    |
    |    |/\_||_/\|    |
    `----' / __ \ `----'
   __/ |#|/\/__\/\|#| \__
  / \_/|_|| |/\| ||_|\_/ \ 
 |_\/    o\=----=/o    \/_|
 <_>      |------|      <_>
 | |   ___|======|___   | |
//\\  / |O|======|O| \  //\\ 
|\/|  \_+/        \+_/  |\/|
\__/  _|||        |||_  \__/
     || ||        || ||
   __|\_/|__    __|\_/|__
  /___n_n___\  /___n_n___\

Notice the way in which the rocket-launcher, torso/arms, and legs increased in height by 1. Now, if the constants are 2, 4, and 7 (respectively), the robot becomes:

Enter rocket-launcher height: 2
Enter torso height: 4
Enter leg length: 7

     ____          ____
    |oooo|        |oooo|
    |oooo|        |oooo|
    |    | .----. |    |
    |    |/\_||_/\|    |
    `----' / __ \ `----'
   __/ |#|/\/__\/\|#| \__
  / \_/|_|| |/\| ||_|\_/ \ 
 |_\/    o\=----=/o    \/_|
 <_>      |------|      <_>
 <_>      |------|      <_>
 <_>      |------|      <_>
 <_>      |------|      <_>
 | |   ___|======|___   | |
//\\  / |O|======|O| \  //\\ 
|\/|  \_+/        \+_/  |\/|
\__/  _|||        |||_  \__/
     || ||        || ||
     || ||        || ||
     || ||        || ||
     || ||        || ||
     || ||        || ||
     || ||        || ||
     || ||        || ||
   __|\_/|__    __|\_/|__
  /___n_n___\  /___n_n___\

Again, notice how each “section” of the robot changes height according to the values of the constants.

To get full points, you should make sure that your robot print out just like the above examples. You should test your robot with a variety of constant values, not just the ones listed in this spec. We will test your robot on other values, as well.

Also, you are required to use function parameters in this assignment. You must read in all of the input sizes in a function named read_robot_inputs. You must print the robot in a separate function named print_robot. The lengths must be passed into the print_robot function.

You may not use string multiplication to implement this.

You must use strings and while loops. The point of this homework is to give you practice with loop-writing. Also, make sure to structure your program with functions, and use a main() function.

Submission and grading

It is due on Friday, 6/30/2017 at 6:00pm.

You should put all of your code in to a python file named robot.py. Submit robot.py to the associated D2L dropbox. Following these turn-in and naming instructions closely is very important, because our grading scripts will depend on some of the details. You may lose points if these instructions are not followed precisely!