Last active
August 29, 2015 13:57
-
-
Save sperelson/9591612 to your computer and use it in GitHub Desktop.
A fun entry into the NML code challenge. The challenge's aims are: 1) with the fewest lines; and 2) in the most obscure, unreadable, unmaintainable manner possible. I've, however, decided to use Python in my personal aim of using a different language for each code challenge.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
if len(sys.argv) == 3: | |
width, height = [int(i.strip()) for i in sys.argv[1:]] | |
drawheight = height | |
while drawheight > 0: | |
if drawheight == height or drawheight == 1: | |
print '*' * width | |
else: | |
print '*' + ' ' * (width - 2) + '*' | |
drawheight -= 1 | |
else: | |
print 'please enter a width and a height' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment