Designer Door Mat

  • + 0 comments

    This one took me a little while, but I appreciated the challenge! For those stuck: try breaking the output down into the upper, middle, and lower sections.

    From there: what is the mathematical relationship between the total characters per line, dash ('-') characters, and design ('.|.') characters? I kept the middle section as one line of static output, and took this into account when looping through the output for the upper and lower sections. The lower section is the inverse of the upper section. Make sure to set your range limits properly, and increment/decrement accordingly!