# Thread: Using Functions To Create A Rectangle

1. ## Using Functions To Create A Rectangle

Hello, I am extremely new to programming and up until then our assignments in class have been fairly easy, but recently I was thrown one that I am having an immense amount of trouble understanding.

The assignment consists of using characters to form the rectangle.
L upper left corner
R upper right corner
t top and bottom
s left and right side
l lower left corner
r lower right corner

I've made the first function in which it prompts for a height and a width, but I am just having an extremely hard time using a for loop to actually make this box using the characters. I apologize for not having any code to in regards to this section, but any help is appreciated!

2. How about starting with a rectangle like this?
----------
|........|
|........|
|........|
----------

If you can manage that, you're half-way there, and have something to build on.

Learning how to break problems down into manageable steps is a vital skill. Now would be a good time to start learning how to do it.

Real problems are not solved by staring at the question, then boom, the answer.

3. Break it down in small pieces.

draw_rectangle(x, y)
- draw ul corner
- draw top line
- draw ur corner
- for loop
- draw left side
- draw right side
- draw bl corner
- draw bottom line
- draw br corner

Think about where the cursor is, and where it has to be, and how to get it there. Your options are printing solid characters, printing spaces, and printing newlines.