logo CodeStepByStep logo

printRockets

Language/Type: JavaScript functions console output
Author: Melissa Hovik (on 2016/09/25)

Write a function named printRockets which prints the following output to the console. Use helper functions to show structure and eliminate redundancy in your solution.

Note that there are two rocket ships next to each other. What redundancy can you eliminate using functions? What redundancy cannot be eliminated?

   /\       /\
  /  \     /  \
 /    \   /    \
+------+ +------+
|      | |      |
+------+ +------+
|Rocket| |Rocket|
|  #1  | |  #2  |
+------+ +------+
|      | |      |
+------+ +------+
   /\       /\
  /  \     /  \
 /    \   /    \
        
Function: Write a JavaScript function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.