Skip to content

Instantly share code, notes, and snippets.

@mailtodanish
Created May 1, 2022 09:22
Show Gist options
  • Save mailtodanish/8521bac571ffb27db8adbc14de8c7a8a to your computer and use it in GitHub Desktop.
Save mailtodanish/8521bac571ffb27db8adbc14de8c7a8a to your computer and use it in GitHub Desktop.
# Read input from STDIN. Print output to STDOUT
# Size: 7 x 21
# ---------.|.---------
# ------.|..|..|.------
# ---.|..|..|..|..|.---
# -------WELCOME-------
# ---.|..|..|..|..|.---
# ------.|..|..|.------
# ---------.|.---------
import sys
r, c = 9, 27
t = int(r/2)
print("\n")
print("Design Door Mat".center(29), "\n")
def print_to_stdout(*a):
print(*a, file=sys.stdout)
for i in range(t):
x = int((c - 3)/2)
print_to_stdout((".|." * i).rjust(x, "-") +
".|." + (".|." * i).ljust(x, "-"))
print_to_stdout('WELCOME'.center(c, '-'))
for i in range(t):
x = int((c - 3)/2)
print_to_stdout((".|." * (t-i-1)).rjust(x, "-") +
".|." + (".|." * (t-i-1)).ljust(x, "-"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment