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
# Greedy Algorithm for Egyptian Fractions | |
# To express a / b as a sum of unit fractions (1 / c_1) + ... + (1 / c_n) | |
def main(): | |
print("*** Greedy algorithm for Egyptian fractions ***\n") | |
while 1: | |
try: | |
a = int(input("Enter a: ")) | |
b = int(input("Enter b: ")) | |
result = iterate(a,b) |
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
/* TrigMountains | |
Version: 1.0, 2012-10-26 | |
By Phillip Kent | |
http://www.phillipkent.net | |
Illustrates the use of randomness to generate visual richness. | |
In each drawing cycle, a sine-shaped solid is plotted, with random magnitude, period | |
and colour. | |
*/ | |
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
/* hextiling | |
Hexagonal tiling | |
Version: 1.3 DEVELOPMENT, 2013-03-22 | |
By Phillip Kent | |
Based on litmus2_hextiling prepared for the Cheltenham Science Festival 2013 | |
[http://design-science.org.uk/litmus-paper/] | |
Acknowledgements: |
NewerOlder