Homework 2 (ASCII Art / Space Needle) FAQ
-
Q: How do I figure out what my loop should go up to? I don't understand nested loops!
-
A: The outer loop is the "vertical" loop and is fairly simple; it generally counts the lines from 1 to however many lines there are in that section of the figure. The inner loop is the "horizontal" one and requires more skill to get right. Use an inner loop for every portion of the line that is repeated, and use the slope-intercept formula and loop tables (as shown in class) to figure out how many repetitions to use.
-
Q: How do I add in the constant?
-
A: Try making a loop table at two different figure sizes and compare expressions from size 10 to size 16 (for example), to help factor out the constant. See section handout 2, Q8.
-
Q: Do I need to eliminate partial-line redundancy?
-
A: Not unless it's a very large and very redundant part of a line.
-
Q: Is this okay for my Part A drawing? Will it get full credit?
-
A: As long as it meets the guidelines in the assignment writeup, it should be fine.
-
Q: What resources can I use to help me get started?
-
A: Chapter 2's case study goes through the process of solving a very similar problem. Mirror.java from lecture also is very similar. See the section 2 handout for loop tables (#4), displaying figures (#6), and constants (#7 and #8).
-
Q: Why are there blank lines at random places in my output?
-
A: This is the result of a known jGRASP bug. Your code is most likely fine if the output works for another constant value.