Designer Door Mat

Sort by

recency

|

1841 Discussions

|

  • + 0 comments
    n, m = map(int, input().split())
    for i in range(n//2) :
        print((('.|.'*(1+(2*i))).center(m,'-')))
    print('WELCOME'.center(int(m),'-'))
    for i in range(n//2, 0, -1) :
        print((('.|.'*(1+(2*(i-1)))).center(m,'-')))
    
  • + 0 comments
    n,m = input().split()
    n=int(n) 
    m=int(m)
    k=m-3
    l=1
    o=k//2
    while o>=3:
        print("-"*o + ".|."*l +"-"*o)
        o-=3
        l+=2
    
    w = (m-7)//2
    print("-"*w + "WELCOME" + "-"*w)
    
    p=3
    q=(m-6)//3
    r=(m-3)//2
    while p<=r:
        print("-"*p+".|."*q+"-"*p)
        p+=3
        q-=2
    
  • + 0 comments
    N, M = map(int, input().split())    
    limit = int((M - 3)/2)
    
    x = limit # + to -
    y = 1 # - to +
    while x >= 3:
        print("-" * x + ".|." * y + "-" * x)     
        x -= 3 
        y += 2 
    
    #central line    
    welcome = (M - 7)/2
    print("-" * int(welcome) + "WELCOME" + "-" * int(welcome))
    
    
    x = 3 # - to +
    y -= 2 # + to -
    while x <= limit:
        print("-"*x + ".|." * y + "-"*x)
        x += 3 
        y -= 2 
    
  • + 0 comments
    h, w = input().split()
    h = int(h)
    w = int(w)
    
    for i in range(w):
        i += 1
        if i <= h//2:
            print((".|." * (2*i-1)).center(w, "-"))
    
    print(("WELCOME").center(w, "-"))
    
    for i in range(w, 0, -1):
        if i <= h//2:
            print((".|." * (2*i - 1)).center(w, "-"))
    
  • + 0 comments

    import math

    N, M = map(int, input().split()) if (5 <= N <= 101 )and(N % 2 == 1): M = int(N*3) center_N = math.ceil(N/2) center_M = math.ceil(M/2) dash_num = center_M - 2

    for i in range(0,N):
        if i < center_N-1:
            print("-"*dash_num,".|."*(2*i+1),"-"*dash_num,sep="")
            dash_num-=3
    
        if i == center_N-1:
            print("-"*(int((M-7)/2)),"WELCOME","-"*(int((M-7)/2)),sep="")
    
        if i > center_N-1:
            dash_num+=3
            j = N - i -1
            print("-"*dash_num,".|."*(2*j + 1),"-"*dash_num,sep="")