Family Day update

This commit is contained in:
Ingy döt Net 2020-02-17 23:21:07 -08:00
parent aac6731f2c
commit 9ad63ea473
2442 changed files with 39761 additions and 8255 deletions

View file

@ -3,7 +3,7 @@ def compress(uncompressed):
# Build the dictionary.
dict_size = 256
dictionary = dict((chr(i), i) for i in xrange(dict_size))
dictionary = dict((chr(i), i) for i in range(dict_size))
# in Python 3: dictionary = {chr(i): i for i in range(dict_size)}
w = ""
@ -27,11 +27,11 @@ def compress(uncompressed):
def decompress(compressed):
"""Decompress a list of output ks to a string."""
from cStringIO import StringIO
from io import StringIO
# Build the dictionary.
dict_size = 256
dictionary = dict((i, chr(i)) for i in xrange(dict_size))
dictionary = dict((i, chr(i)) for i in range(dict_size))
# in Python 3: dictionary = {i: chr(i) for i in range(dict_size)}
# use StringIO, otherwise this becomes O(N^2)