Created
April 5, 2015 19:05
-
-
Save Mitame/8e6152f3121888b5c04e to your computer and use it in GitHub Desktop.
Estimates the average size of a Powder Toy save.
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
#!/usr/bin/env python3 | |
import urllib.request | |
import random | |
sizes = [] | |
try: | |
for x in range(0,500): | |
saveID = random.randint(0,1700000) | |
save = urllib.request.urlopen("http://static.powdertoy.co.uk/%s.cps" % str(saveID)).read() | |
print("%s: %s bytes"%(str(saveID),str(len(save)))) | |
sizes.append(len(save)) | |
except: | |
print("ERROR") | |
print("Average: %s" % str(sum(sizes)/len(sizes))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment