Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Mono Captcha solution in Uncategorized category for Mono Captcha by capback250
# migrated from python 2.7
from functools import reduce
ZERO = [1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1]
ONE = [0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0]
TWO = [1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1]
THREE = [1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1]
FOUR = [1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1]
FIVE = [1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0]
SIX = [0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1]
SEVEN = [1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0]
EIGHT = [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1]
NINE = [0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0]
def checkio(image):
numberOut = ''
for x in range(0, len(image[0])-1, 4):
res = []
for index, number in enumerate([ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE]):
a = [x[0] == x[1] for x in zip(reduce(list.__add__, [string[x+1:x+4] for string in image]), number)]
res.append((a.count(True) - a.count(False), index))
numberOut += str(sorted(res,key=lambda x:x[0])[-1][1])
return int(numberOut)
Feb. 21, 2016