Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Toad solution in Speedy category for Striped Words by veky
def checkio(text, transition=(
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,192,192,192,
192,192,192,192,192,192,192,192,192,192,192,192,96,96,96,96,96,96,96,96,96,96,
192,192,192,192,192,192,192,576,288,288,288,576,288,288,288,576,288,288,288,288,
288,576,288,288,288,288,288,576,288,288,288,576,288,192,192,192,192,192,192,576,
288,288,288,576,288,288,288,576,288,288,288,288,288,576,288,288,288,288,288,576,
288,288,288,576,288,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
192,192,192,192,192,192,96,96,96,96,96,96,96,96,96,96,192,192,192,192,192,192,
192,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,
96,192,192,192,192,192,192,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,
96,96,96,96,96,96,96,96,96,192,192,192,192,192,192,192,192,192,192,192,192,192,
192,192,192,192,192,192,192,192,96,96,96,96,96,96,96,96,96,96,192,192,192,192,
192,192,192,576,288,288,288,576,288,288,288,576,288,288,288,288,288,576,288,288,
288,288,288,576,288,288,288,576,288,192,192,192,192,192,192,576,288,288,288,576,
288,288,288,576,288,288,288,288,288,576,288,288,288,288,288,576,288,288,288,576,
288,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
192,192,96,96,96,96,96,96,96,96,96,96,192,192,192,192,192,192,192,384,96,96,96,
384,96,96,96,384,96,96,96,96,96,384,96,96,96,96,96,384,96,96,96,384,96,192,192,
192,192,192,192,384,96,96,96,384,96,96,96,384,96,96,96,96,96,384,96,96,96,96,96,
384,96,96,96,384,96,192,192,192,192,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,96,
96,96,96,96,96,96,96,96,0,0,0,0,0,0,0,96,480,480,480,96,480,480,480,96,480,480,
480,480,480,96,480,480,480,480,480,96,480,480,480,96,480,0,0,0,0,0,0,96,480,480,
480,96,480,480,480,96,480,480,480,480,480,96,480,480,480,480,480,96,480,480,480,
96,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,96,96,96,96,96,96,96,96,96,
0,0,0,0,0,0,0,384,96,96,96,384,96,96,96,384,96,96,96,96,96,384,96,96,96,96,96,
384,96,96,96,384,96,0,0,0,0,0,0,384,96,96,96,384,96,96,96,384,96,96,96,96,96,
384,96,96,96,96,96,384,96,96,96,384,96,0,0,0,0,0,192,192,192,192,192,192,192,
192,192,192,192,192,192,192,192,192,96,96,96,96,96,96,96,96,96,96,192,192,192,
192,192,192,192,96,480,480,480,96,480,480,480,96,480,480,480,480,480,96,480,480,
480,480,480,96,480,480,480,96,480,192,192,192,192,192,192,96,480,480,480,96,480,
480,480,96,480,480,480,480,480,96,480,480,480,480,480,96,480,480,480,96,480,192,
192,192,192,192
)):
striped = state = 0
for byte in text.encode():
state = transition[state + byte]
if not state:
striped += 1
return striped + (state == 480 or state == 384)
March 1, 2015
Comments: