Skip to content

Instantly share code, notes, and snippets.

@sperelson
Last active August 29, 2015 13:57
Show Gist options
  • Save sperelson/9591612 to your computer and use it in GitHub Desktop.
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.
#!/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