# gif.py

Created by schraf

Created on October 25, 2021

4.98 KB

Explications en vidéo

```from kandinsky import fill_rect
from time import sleep

img = b"!3K#%\$7#)\$4#-\$1#-#2#&#R#.#1#)#P#.#/#-#N#.#-#0#L#/#-#0#K#0#-#1#J#0#,#2#I#2#+#3#I#1#,#2#I#0#-#3#H#/#/#3#G#/#0#3#E#+#\$#\$#1#3#E#*#6#4#C#+#6#5#A#-#4#7#@#.#3#7#?#/#3#8#>#/#3#9#<#1#2#8#=#1#1#9#=#1#1#:#<#1#0#;#<#2#.#=#;#2#0#;#:#3#1#:#;#2#1#:#;#2#1#:#;#2#1#:#:#3#1#9#;#3#1#2###%#>#3#2#1###%#>#3#2#5#>#4#2#3#?#4#2#0#B#5#1#1#B#6#/#1#C#:#*#2#C#@###2#C#R#B#R#2!3K#%\$7#)\$4#-\$1#-#2#&#R#.#1#)#P#.#/#-#N#.#-#0#L#/#-#0#K#0#-#1#J#0#,#2#I#2#+#3#I#1#,#2#I#0#-#3#H#/#/#3#G#/#0#3#E#+#\$#\$#1#3#E#*#6#4#C#+#6#5#A#-#4#7#@#.#3#7#?#/#3#8#>#/#3#9#<#1#2#8#=#1#1#9#=#1#1#:#<#1#0#;#<#2#.#=#;#2#0#;#:#3#1#:#;#2#1#:#;#2#1#:#;#2#1#:#:#3#1#9#;#3#1#2###%#>#3#2#1###%#>#3#2#5#>#4#2#3#?#4#2#0#B#5#1#1#B#6#/#1#C#:#*#2#C#@###2#C#R#B#R#2!,6#\$\$5#+\$2#-#2#'#R#-#0#*#P#/#.#,#O#/#,#/#N#/#,#/#N#/#,#0#M#0#,#/#M#0#,#/#L#0#-#0#K#0#,#1#K#0#,#1#N#-#-#1#L#*###\$#/#0#K#+#2#1#J#*#6#.#J#*#6#.#J#*#6#.#I#+#6#.#H#-#5#.#H#-#,#\$#)#/#F#/#*#%#)#/#F#/#)#&#(#0#F#/#)#&#(#0#F#0#(#&#(#0#E#1#'#'#'#2#D#1#%#(#(#2#D#1#\$#(#)#2#D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#0#G#*#8#0#E#+#8#0#E#,#8#/#D#.#7#/#D#/#6#/#C#0#5#1#B#1#4#1#B#1#3#2#B#2#1#3#A#3#/#5#B#2#.#7#A#2#-#7#B#2#,#8#B#3#)#:#B#3#&#=#B#3###/###2#B#=#'#2#C#:#)#2#C#9#+#1#C#7#-#1#C#6#.#1#C#4#0#2#B#3#1#2#B#3#1#3#A#3#1#3#B#2#1#2#D#2#0#2#D#2#0#2#D#1#1#3#C#1#1#3#C#2#0#3#3"

COUL = [(0,0,0),(255,255,255)]
w,h = 80,55
r = 320 // w

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(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():
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

while True: aff()```