From aeee2c599f3173deecb834409c786ccb775475e9 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Wed, 6 Apr 2011 23:38:53 -0400 Subject: [PATCH] Corrected 031 and 059 to work with the loader script --- e031.py | 5 ++++- e059.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/e031.py b/e031.py index cf58638..ebd6be8 100644 --- a/e031.py +++ b/e031.py @@ -25,6 +25,9 @@ def combinations(amount, denominations): n += 1 return total -if __name__ == '__main__': +def main(): coins = [200, 100, 50, 20, 10, 5, 2, 1] print combinations(200, coins) + +if __name__ == '__main__': + main() diff --git a/e059.py b/e059.py index 8b442dd..b79891f 100644 --- a/e059.py +++ b/e059.py @@ -87,7 +87,7 @@ def get_key(encrypted, key_len=3): return sorted([s for s in scored if s[0] > 1]) -if __name__ == '__main__': +def main(): #e = encrypt('Myles is a ridiculous dog who loves his bone', 'amz') #print get_key(e) with open(os.path.join(os.path.dirname(__file__), 'p059', 'cipher1.txt'), 'r') as codefile: @@ -99,3 +99,5 @@ if __name__ == '__main__': print d print 'Sum:', sum([ord(c) for c in d]) +if __name__ == '__main__': + main()