from kandinsky import fill_rect from time import sleep from random import randint,random def memoire(n): if n == 0: return b"!L$###J#%#E#%#H#'#D#'#=#$#)###%###C#$#%#$#>###'###'###B###(#$#=###%#$#(###@#$#$###%#'#.###*#$#$#&#*###8#%#&#$#$#$#$###$#$###$#*#$#*#$#/#%#9#$###%#%###(###$###*#%#)#%#/###$#$#9#%#0###)#%#*##$#6###<#%#+#'#&#(#%###%###3#%#)#)#+#&#-#1#'#$#3#&#'#*#%#+#0#&#%#)#&###4#'#$#*#)#'#9#*#8#*#%#%#)##%#)#,#-#$#*#'#'#'###'#5#8#(##*#?#$##3#%#N#/#.#,$7##>+" if n == 1: return b"!IN#$$1###)#%$1###(#$###$$.###$###%#$#&###C#%#?#%#$#&#(###B#&#>#%#%#$#)###A###%#$#<#&#/#$#?###A#&#/#$#7#$#'###$#$#?#&#-#$#:###%#$#$#$#%#$#;#-#(#$#8#&#%#$#%###$###6###'#,#%#%#5#$#$#$#*#$#$#$#####3#%#*#(#$###7#$#1#$#$###5#%#(#(#'#$#2#&#(#'#(#$#7#%#%#*#%#$#3#'#&#*#&###,#$#.#/#7#5#.#%#4#+#6#(#&#%#&#%#*##,#)#$#4#%#(#.#9#4#3#'#(#,#<#0#,#-#%#&#$#($##*>," if n == 2: return b"!CH#$$<##%R#$#*#&$-#%#$###%#($,#&#%#&#&##$,#&#.##$,#%#.###>#$#E#%#I#&#A###%#%#-###;#$#$###A#$#&#(#'#%#:###&###A#$#(#'#%#$#4###'###H#%#'#&#'###4###%#$#$#$#%#$#A#$#&#'#&#$#4#&#%#$#%###$###@#-#$#%#1#$#.#$#$###C#*#'###/#%#1#$###$#B#)#&#$#.#&#(#&#&###$#$#C#)#$#$#/#&#&#*#'###E#(#3#3#K#)#2#(#%#&#%#$#J#)#;#$#(#$#I#+#%#%#1#&#)#.#@#.#'#'#%#%#%#%#&#.#V###/#-=S" if n == 3: return b"!=O##$<##%Q#%$8#&$8#&#$##$5#&#$#+$-#&#%#'###%$*###$#%#-##$*#$#$#$#-##$+###%#$#,##$+#$#&#$#*###7#%#J#$#&#%#(###7#&#J#$#&#%#'###6#$#N#$#%#&#%#%#4#$#P#*#&###5###)#$#J#)#&###3#$#$#$#%#$#K#(#%#%#,###%#%#%#$#$#$###$#J#'#%#%#+#%#2#$#I#(#0#%#1#$###$#H#'#&###+#&#(#'#(#$#I#'###&#*#'#$#+#'###J#'#/#4#O#'#/#'#&#&#&###O#'#7#%#)###+#%#B#(#(#'#*#&#)#.#C#/#$#+#$3#&>&" if n == 4: return b"!2(##'5#%$8#&#$##$5#&#$#$#'#$$-#&#%#+$*###$#%#&#$#&#$$*###%#$#-##$*#$#%#$#,##$+#$#%#$#+##$,###'#$#)##$-###'#%$4###&#'#%#$$.#$#$#'#$#%$/#+#%##$1#)#%##$2#(#$#%$1#)#%##$2#(#%###+#$$'#(#$#%#)#&$'#'#$#%#(#$#$#$$&#'#-###'##$&#'#########'###)#$$%#&#&###%#$#$#$#%#$$%#&#'#&#%#$#%#####%$##%#$#$#2#$$$#(#1#$###$$##(#(#'#(#$$##)#%#*#'##$%#5$,#&#'#%#&###.#%$$#%#)#$#)#&#Q#%#)#&#)#-#R#-#$#3?A" if n == 5: return b"!-J##%V##$7#%#####)#$$-#&#$###%#($,#&#$#'#%#$$,#&#%#$#(##$,#&#-##$*###$#%$6#$#%#$#-##$*#$#&#&#)##$+#$#'#'#%#%$+#$#'#'#&##$,#$#&#(#&##$-#,#$#%$/#+########$1#)#&##$1#)#$#%$1#(#$#$$2#($7#($7#($7#($7#($7#$#%##$6###'##$,###$###&#$#$###%#$$.###$#$#$#$#%#$$/#%#&###%###$#$$(#$#2#$$'#%#1#$#$#$$$#&#(#'#(#$$%#'#%#*#'##$#1###R#&#'#%#&#$#-#%$%#%#)###)#&#Q#%#)#'#(#-#R#-#%#2?F" if n == 6: return b"!0K#$#+#$$9#&$1###'#$###$$.#$#####%#%$1#%#$#&#(##$,#%#&##$3#&#/##$+#&#.#$$*#'#,#$$-#-#'#$$&#%#)#(#&#$$'#%#)#(#$#$####$(#$#(#)#&#$$)#%###,#$#%$,#-$6#)$6#)$6#)$7#($8#($+#%#,#($(#&#.#*$$###%###0#&$$###'##$/###&#$#$###%#$$.###$#$#%#$#%#$$+###$#&#%###%###$#$$(#$#2#$$(#%#1###$#$$$#&#)#&#(#$$%#'#&#*#&##$'#3#1###R#&#'#%#'###-#%$%#%#)###)#&#Q#%#)#'#(#-#S#,#%#2?K" if n == 7: return b"!7%#$$9#%$8#$#$##$.#$#(#$#&##$4#$$6###$#%#)#$$*#$#$#&#*#$$*#$#/#$###$$'##$$'#'#(#%#'###$#$$$#(#$#*#(#$$%#2#&#$$0#*$4#+$(#&#(#.#+#$#S#8#'#&#I#%#6#3#I#'#9#-#K###%##$6#$#&##$/###&#$#$###%#%$-###$#$#%#$#%#$$+###$#&#%###%#$###$$(#$#2#%$'#%#1###$#$$%#%#)#&#)##$&#'#%#*#&#$$#1###R#&#'#%#'###.#$$%#%#)#$#(#'#Q#%#(#'#(#-#S#,#%#2?P" if n == 8: return b"!D?#%$9#&$7#$#$#$$6###'##$4#$#(#$$2###)#'$'###$###%#$#)###$#'#+###9#%#:#&#-###$#$#*#$#9####%###0#$#+#$#8#$#$###6#$#+##$#8#$#&###5#%#(#*#-#%#1#######'###(#%#2#&#&#.#(####$#%#$#$#%#$#2#+###5#4###$#&#%#$#$#$###$#0#(#'#2#5#%#1#%#9#0#8#%#1###$#$#6#%#D#&#(#&#)#$#-#,#F#'#%#*#'###/#(#I#3$,#&#'#&#&###.#$$%#%#)#$#)#&#Q#%#(#'#)#-#R#,#%#3?T" if n == 9: return b"!K2#%$/#$#)#&$1###'#$#%###D#%#F#$#I#&#>###$#'#%###$###B###&###<#%#$#%#%#$#%#$#@###'###;#%#+###%#$#8#$#'###)#$#9#%#.#$#####6###$###%#$#)#$###$#6##$#8#&#*###$#$###$#3#'#%#'#'#$#7###%###.###$#$#+###+#/#%###$#$#3#$#,###*###+#$#(###+#)#&#%#3#%#(#)#0#%#(#%#*#%###%#%###5#&#&#+#-#&#*#&#'#%#'###8#+###,#(#'#.#,#'#$#-###*#(##9#$#'#&#(#%#4#3#=#%#$#.#4#1#B#/#-#-#&#&$*#*>*" if n == 10: return b"!FE#$$<###*#$$9#%$/###$###&#%###$$-#%###$###%#&##$,#&#$#&#G#$#A#&#*#$#$###?#&#@#&#*#$#$###?###%###@#&#.#$#<###'###@#&#,#$#5#$#(###(###<#$#&#*#'###6###&###*###;#%#)#'#&#$#6#'#)#$#$###:#$#(#(#$#%#4###%#$#*###$#$#;#%#&#(#8#$#2###$#$#:#)#%#$#&#$#1#%#)#&#&###$###?#%#&#$#$#$#2#&#&#*#&#$#A#$#'###5#3#H#$#&###4#)#%#+#/###9#$#%#%#*###3#.#*#%#:#2#3#9#<#/#*#'#$#&#%#3#T#*#,#(=U" if n == 11: return b"!@L##$<##%Q#%$8#&#$###'#&$,#&#$#,$,#&#%#&#&##$-#%#-##$*###$#%#*###$##$*#$#%#$#)#$#=#$#F#$#%#%#C#&#F#$#&#&#(###9###%###F#$#'#%#&#%#7###L#$#&#&#<#$#(#$#E#$#$#(#&###5#$#*###G#*#%#%#.#$#$#%#*#$###$#F#$#%###%#%#.#$#2#$#G#$#%###2#�#$#$#$#E###*#$#,#'#'#'#)###G###%###$#%#,#3#&###H#$#%###0#4#M#$#$#$#0#(#&#*#M#$###%#+###/#-#,###@#)#'#%#$#$#*#:#A#.#(#)#$0#+=V" if n == 12: return b"!7V#$$;##%P#&$8#&$7#'#$###(#$$-#%#%#+$*###$#&#&###'#$$)#$#$#%#-##$)#$#%#$#)#$#$##$*#$#&#$#'#$$.#$#&#%$4#$#&#&#'##$-#$#&#&#%#$$.#$#$#'#%#%$/#*#6#%#T#%###%#&###0#&#U#$#%###$#&#/###%###U###%#$#%###/#$#&###T#$#%###-###&#$#(#$#S###%###$#%#)###$#$#*#$#R#$#'#%#'###$#&#)#$###$#Q#$#$###*#$#2#$#R#$#####*#%#1###$#$#O#'#(#&#)#&#)###Q#&#(#'#&#*#&#$#R#&#(#3#X#&#(#&#'#+#.#$#J#&#/#-#*#&#K#*#)#9#N#0#%#3?>" if n == 13: return b"!0G##$7#%####$6#&####$6#&#$###'#%$-#%#%#+$-#%#&#%#&#$$*###$#%#-##$*#$#$#$#)#$#$##$*#$#%#$#(#$#$##$+#$#%#&#)##$,#$#&#&$3#$#&#'#$#%$-#$#%#(###%$.#,$4#*#%#$$1#$#$#%###%$1#$#%#$#%##$2###&###&##$2###%###$#%$2#$#%##$7#$#$###(#%$/#$#####(#&$.#'#&###%##$/#&#&###&##$/#%#,#%$-#%#,#$$+###$#$#+#$###$$(#$#$#%#-#%$'#%#$#%#,###$#$$%#&#$#%#$#%#)##$&#'#$#+#&#$$$,#&#'#+#.#$$%#-#)#'#Q#%#(#9#R#,#%#2?D" if n == 14: return b"!-K##%W###)#$$/#$#*#&$-#%#$###%#$#%##$-#%#$#'#'##$+#&#&###&###$##$,#%#*#$$/#&#*###%##$,#&#-#$$(#$#&#)#&#%$)#$#(#($/#$#(#(#&#$$)#%#&#)#$#$$,#.#&##$.#&#&#$#%#$$0#$#&###$#%$1#$#&##$6#$#&##$6#$#%##$7#($8#'$3#%#$#'$2#&#%#&$0#$#$###&#'$-#$#&###'#(#X#######'###)#$#&#&$%###$#%#)#$$+###$#&#)#$###$$(#%#1#%$'#%#1###$#$$%#&#(#'#(#$$%#'#%#*#'##$#0###R#&#'#+#.#$$%#.#)#&#Q#%#(#9#R#,#%#2?I" if n == 15: return b"!2?##$:#%$.#######)#&$1###'#$#%##$4#%$2#$#$#'#$#$#$##$,#%#%###&#$#%#$$)#&#/#$$)#&#.###$##$(#'#(#$#(#$$(#0#%#$$-#$#$#)#(##$$#%#*#)#&#$$%#&#(#%#%#$#%##$(#&#%#&#'##$.#+#'##$5#%#&#$$5#&###%$6#+#$#&#R#$#4#-#R##'#R#$#%##$6###'##$,#######'###)#$$-###%#$#)#$$+###$#&#*#####%$(#$#2#$$'#%#1#$###$$%#&#(#'#(#$$%#'#%#*#'##$$,#%#(#*#.#%$$#.#)#&#Q#%#(#9#R#-#%#2?M" if n == 16: return b"!=%#$$9#&$8#$###$$6#$#&##$.###'#$#(#$$-###&###%#$#%#$$-#####%#%###%#$###$$)###$#%#-#$$(#$#2###$#$$%#%#*#%#)##$&#&#'#)#2###Q#'#$#-#.#%#A#$#0#)#%#&#&###,#%#A#	#%#)#%#%#'#A#$#%###8#&#)#+#B###'###-#&##<###$###&#$#(#$#+#+#U#$#)#$$.#&#*#####%$(#$#2#$$'#%#1#$#$#$$$#&#(#'#(#$$%#'#%#*#'##$#1###R#&#'#*#.#%$%#-#)#&#Q#%#)#8#R#-#%#2?R" w,h = 80,55 r = 3 def taille(n): return 54 * (n[0] - 35) + n[1] - 34 def remplir(x,y,t,c): while t > 0: d = min(t, w - x) fill_rect(60 + r*x,2+r*y,r*d,r,c) x += d t -= d if x == w: x = 0 y += 1 if y >= h: y = 0 return x,y def aff(): k, sens = 0, 1 COUL = [(255,255,255),(0,0,0)] while True: sleep(.01) k = (k + 1) % 17 img = memoire(k) i = 0 x,y = 0,0 while i < len(img): v = img[i] if v == 32 or v == 33: c = v - 32 i += 1 sleep(.02) else: t = taille(img[i:i+2]) x,y = remplir(x,y,t,COUL[c]) i += 2 c = 1 - c fill_rect(0,0,320,222,(0,0,0)) aff()