Update grader.py

This commit is contained in:
Michael Zhang 2017-03-14 23:10:31 -05:00 committed by GitHub
parent 9f03f49966
commit f0010a5962

View file

@ -37,7 +37,7 @@ def getspace(size):
def generate_image(string, debug=False): def generate_image(string, debug=False):
size = 0 size = 0
binstring = bin(int(string.encode("hex"), 16)).strip("0b") binstring = bin(int(string.encode("hex"), 16)).strip("0b")
while size < 2 or getspace(size + 1) < len(binstring): while size < 2 or getspace(size + 1) - 80 < len(binstring):
size += 1 size += 1
n = getspace(size) n = getspace(size)
# print size, len(binstring) # print size, len(binstring)