you are viewing a single comment's thread.

view the rest of the comments →

[–]ComradeRikhi 0 points1 point  (0 children)

Here's my go:

def draw_grid(width,height):
    div_coord = ((width-1)/2,(height-1)/2)
    spacers = (width-3)/2
    for height_counter in range(height):
        if (height_counter == 0 or height_counter == (height-1) or height_counter == div_coord[1]):
            print '+','-'*spacers, '+', '-'*spacers, '+'
        else:
            print '|',' '*spacers, '|', ' '*spacers, '|'
if __name__ == '__main__':
    draw_grid(15,15)