mirror of
https://github.com/correl/euler.git
synced 2024-11-27 11:09:54 +00:00
Corrected 031 and 059 to work with the loader script
This commit is contained in:
parent
43ecfff029
commit
aeee2c599f
2 changed files with 7 additions and 2 deletions
5
e031.py
5
e031.py
|
@ -25,6 +25,9 @@ def combinations(amount, denominations):
|
||||||
n += 1
|
n += 1
|
||||||
return total
|
return total
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def main():
|
||||||
coins = [200, 100, 50, 20, 10, 5, 2, 1]
|
coins = [200, 100, 50, 20, 10, 5, 2, 1]
|
||||||
print combinations(200, coins)
|
print combinations(200, coins)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
4
e059.py
4
e059.py
|
@ -87,7 +87,7 @@ def get_key(encrypted, key_len=3):
|
||||||
return sorted([s for s in scored if s[0] > 1])
|
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')
|
#e = encrypt('Myles is a ridiculous dog who loves his bone', 'amz')
|
||||||
#print get_key(e)
|
#print get_key(e)
|
||||||
with open(os.path.join(os.path.dirname(__file__), 'p059', 'cipher1.txt'), 'r') as codefile:
|
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 d
|
||||||
print 'Sum:', sum([ord(c) for c in d])
|
print 'Sum:', sum([ord(c) for c in d])
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
Loading…
Reference in a new issue