Skip to content

Instantly share code, notes, and snippets.

@garydoranjr
Created November 18, 2010 06:09
Show Gist options
  • Save garydoranjr/704683 to your computer and use it in GitHub Desktop.
Save garydoranjr/704683 to your computer and use it in GitHub Desktop.
Prints a silly status message
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
import string
import sys
def recurse(levels, path):
if levels == 0:
left = string.uppercase[path]
right = left + "′"
else:
left = '“' + recurse(levels - 1, 2*path + 0) + '”'
right = '“' + recurse(levels - 1, 2*path + 1) + '”'
return 'You say ' + left + ', I say ' + right
if __name__ == '__main__':
# Takes one argument from 0 to 4
levels = int(sys.argv[1])
print recurse(levels, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment