Skip to content

Instantly share code, notes, and snippets.

@ooade
Created November 22, 2019 10:11
Show Gist options
  • Select an option

  • Save ooade/7a4e85e67d1b1fb32dfade806acf0e5e to your computer and use it in GitHub Desktop.

Select an option

Save ooade/7a4e85e67d1b1fb32dfade806acf0e5e to your computer and use it in GitHub Desktop.

Revisions

  1. ooade created this gist Nov 22, 2019.
    22 changes: 22 additions & 0 deletions doormat.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    n, m = input().split()
    n = int(n)
    m = int(m)

    extra = 0
    reversed_iteration = False
    tracker = []

    for i in range(0, n):
    if int(n/2) == i:
    print('WELCOME'.center(m, '-'))
    reversed_iteration = True
    else:
    if reversed_iteration:
    print(tracker[n - i - 1])
    else:
    decoration = '.|.' * (i + extra + 1)
    print(decoration.center(m, '-'))
    tracker.append(decoration.center(m, '-'))
    extra += 1