# Ryan Martin
# macid: abcd123
# student number: #######
# August 8, 2011
#
# This is a solution for Marked Assignment 3 (Lab 07) on Tuesday.

def makeEdgeRow(w, c):
    '''Returns a string of length w made of c.'''
    
    line = c * w
    return line

def makeRow(w, c):
    '''Returns a string of length w with c at 0 and w and an empty interior.'''
    
    line = c + ' ' * (w - 2) + c
    return line

def makeRightTriangle(w, p):
    '''Returns a list of lines that form a hollow right triangle 
	of width and height w > 1 made of the pattern p.'''

    result = []
    result.append(makeEdgeRow(1, p[0]))

    for i in range(2, w):
        result.append(makeRow(i, p[i - 1]))

    result.append(makeEdgeRow(w, p[w - 1]))

    return result

'''
Design Question

To make both height and width variable in 
makeRightTriangle, only the lines of code inside
the loop in makeRightTriangle need to change.
Since nothing else depends on the height
except that loop, everything else would
remain the same.

Testing Report

Test: 1 for function makeEdgeRow
Input: [(5, '@')]
Expected Output: ['*******']
Actual Output: ['*******']
Result:pass

Test: 1 for function makeRow
Input: [(5,'$')]
Expected Output: ['@@@@@']
Actual Output: ['@@@@@']
Result:pass

Test: 1 for function makeRightTriangle
Input: [(7, 'THETEST')]
Expected Output: [['T', 'HH', 'E E', 'T  T', 'E   E', 'S    S', 'TTTTTTT']]
Actual Output: [['T', 'HH', 'E E', 'T  T', 'E   E', 'S    S', 'TTTTTTT']]
Result:pass

'''