hal2024.py

Created by schraf

Created on November 03, 2024

6.74 KB

Explications pour transformer un gif animé en animation pour ta NUMWORKS


from kandinsky import fill_rect
from time import sleep

def memoire(n):
 if n == 0: return b" I6 5'###*##$-###C###L#$#%###6#$#%###(###C#$#=#$#*#$#D#$#<#%#####$#%#D#######>###N#######=###'###G#######9###'###$#$#I###=###&##$/#$*3"
 if n == 1: return b" 2:#$$3#######>#$#L#$#=#$###$#B#$#&#########%#9#$#####(###<#%#'#&#%#$#6#######)#$#=###(###%#%#5###$###$#%#$#$#@#######&#$###$#3#%#$#%###$#####A###$###'###$#$#0#&#$#######$#$#####A#'###&#6#$###$#&#&#B#######'#$#8#&#$#%#####A#(###%#9#####$###'#?#########(#####8#$###)#####@#*#####:#####*#A#####&#####9#'###(#A###$#$#####;#$###$###%#####B#######$###;#%###$#$###E###$###=#######$#$#####2 1'#$#<#$###$#J#######=#$###$#H#####%#:#%###%#I#####%#;#'#'###:#$#'#$#######$#8#$#$#######&#######8#####$#)#%#####&#$#2###$###+#%#9###*#######$#####$#$###-###%###%#####$#$#%#9#$###%#$#####$#####$#$###%#+#$#####$#%###&#$#%#####=#######(#$###%#.#%#%#####$#$#$###$#%###:#$#$###'#######%#$#*#'###########$#$#%#####?#(#$#'#2#$#$#$#####&#'#@###&#####'#0#$#%#&#&#%#####@###########'#$#5#'#$#&#$###>#*#$#%#6#####%###)#<#####$###$###'#####4#%###,#####;###%#%###)#5#(###$###$#A#,#####4###$###$#)###%#<###%#'#$###6#%###%###*#."
 if n == 2: return b" ,X#$$3#####$#;#####$#J#####&#9#####%#####:#$#%###*#(#8#####(#*###3###$###)#####(#8#*#(#$#4#%#)#*#'#$#0#+#$#$#$###1#$#%#$#(###$#%#$###&#$#1#+#%#$#######%#/#%###$#'#$#$###$#$#&###$#$#-###$#'#$###%#'#4#&#&#+#$#%###$#+###%###$#%#$#$#$#&#4#%#$#'###)###)#(#$#$###$#-###(#2###(#$#####%###$#####)###$#'#$#####$#%###-#$#$#0###(#$###%#(#%#&#$#&#*###'#%#$#####>#)#$#(#'#$#)#############%#'#&#<#$###,###%#'###)###$#(#'#'#<#2#-#$#&#(#&#%#####;###$#-###$#3#)#$#(#####8#####)###*#2#####2#8#$###2#1#%###(#$#'#####8#1###$#0#####4#8#####1#2#########+#$#&#7#1#####3#&###1#+ '?#&#S#$#'###-#%###%#S#$#%#$#,#+#S#$#$###,#$###)#8#&#9#$###$#+#####+#7#$###&#-###,#%#+#.#6#####)#+#$#(#)#*#/#(#$#-#-#*###.#%#)#$###,#'#$#.#####,#$#$#$#$#-#'#&#&#%#(#####&#$#0#-#%#$#####&###(#$#$#&###########$#%#%#%###&###&#%#)#$###)###$#%#%###%#(#$#&#1#%#%#$#$#%#$#+#+#$#######$#'#*###)#'###/#$#$###%#,###$#'#$#&###'#2#'#%#%#$#$#%#*#%#%#)###%#/###%#/#$###&#%###&###$#/#*#3#&#$#/#(#-#+#(###%###$#1#4#$###(#+#'#$#&#'#$#$###%#&#%#)#3#-#)#'#(#$#'#$#####$#&#'#)#1#####$###*#%#####(#)###(#&###'#'#)#1#####8#,#+#$#$#'#+#.#;#/#$#$#)#&#,#,###$#9#/#$#%#####'#$#+###$#+#%###8#.#$#&#7#*#####:#4#####5#####)#&###7#5#%###-#######'#'#################3###$#3#####/###&###%#$"
 if n == 3: return b" $8#$#%###2#&#S###$#$#0#$###&#R#$#####0#####)#R#%#.#$###*#8#$#7#'#.#/#5#(#5#'#-#####.#4###$#'#1###'#%#+#1#)#$#*#####+#/###&#'#)#$###/#(#$#+#.#'#$#&#$#%#$###&#'#&#$#+#####'#$#+#####.#'#$#%#$#$#$#%#'#$#####%#&#'#$#$#'#$#,#####-#(#$#$###%###'#'###(#%#%#&#$#'###'#%#$#1#(#&#,#(#$#*#&#$#'#$#&#$#&#####,###%#'#'#+#####%#%#1#&#$###&#'#-#$#%#&#(#*#(#&#0#$#(#&#%###,#$#'#%#(#)#%###&#'#%#$#%#$#$###.#%#$#$#(###)###'#####(#####)#(###&###%#.#$###%#%#$#3#+#########)#/#-#$#%#%#7#-#'###&#/#(#$#'#$#$#%#5#,#$#######*#-#'#*#%###$#$#6#*#####/#'###%#'#'#$#$#####$###,#%#-#)#%###.#%#$###)#)#$###$#$#+#'#-#'#########<#.#)###$#)#-#&#$###>#0#)#*#-#&#&###;#1#)#)#*#########$#########<#2#)#)#-#&#####=#1#####)#(#,#####$#####%###:#1#-#%#,#####$ #$###'###4#&###&#J#'#4#$###+#,#####'#7#*#0#$###.#*#####*#6#########&#.#####/#+#-#,#%#'###&#&#,#$#######/#)#####.#+#%#,#&#(#######$#3#'#$###/#+#$#-#&#%#$#######4#)#$###&#&#$###$#+#%#,#&#######&###3#(#(###'#%#%#+#$#-#)#######$###2#'#'###%#%#####'#*#$#+#####,#####$#2#&#&###%###%#$#(#(#%#*#####$###&###&#&#0#'#%###%###%#$#*#'#%#(#$###)#%#&#&#,###$#'#$#$#%###%#(#'#&#%#&#########)#&#&#&#)#%#%#(#$###$#'#'###(#$#&#%#########$###'#&#'#$#&#'#&#(#$###%#$#)###/#$#(###(#'#+#'#'#(#$###)#####$#0#&#$###+#)#*#%#(#####&#####(#&###$#.#&#####-#)#1#######$#&#/###.#&#'###)#*#%#$#)###$###'###.#$#0#&#.#+###&#%#&#$###%###.#&#/#####$#$###,#1###'#$#%#/#(#0#$#0#5#&###)#&#'#'#/#%#/#4#-#$#&#%#&#&#-#%#1#2#-###$###&#'#$#&#-#$#2#*###'#-###$###'#.#*#####$#4#'#$#%#-#'#(#.#+#%#6#$#1#(#####(#.#+#$#E#)#####*#-#(#####&#C#+#####$###'#,#&###$######"
 if n == 4: return b" ###)#-#%###>###'#4#'#######*###D###)#1#(###$###+###A###+#$###/#%#$#1###'###7#$#,#3#9###7###/#.#####3###$###$#$#7###2#*#(###$###+###(#%#6#$#2#'#$#$#$#######-#$#(#%#6###5#&#4#$#)#'#%###/###7#$#'###.#%#)#'#2#$#.#$#)#$#####2#%#*#&#$#$#.#######+#$#$#&#%#$#3#&#*#&#1###-#$#*#####%#1#(#;#$#-###,#%#2#)#,#########$#*###$###*#$#(#$#%#$#1#+#-#&#)#$#,#$#&#%#$###$#$#####/#*#.#(#'#######+###&###(#&#0#+#%#$#*#)#0###'#(#%#$#0#*#%#&#+#'#%###+###'#$#'#$###$#0#1#)#$#)#######$###&###1#&#/#1#$###$###+#%#(#$#-###'#$#0#0#$#&#$#$#(###########%#$#+#%#####&#$#0#:#)###$#%#.###$#&#$#$#0#9#*#$#3###&#'#1#8#8###.#$#2#.###(#6###2#$#####2#+#%#$#7#$###'#&#(###$#6#(#2###(###$#######$###%###$###(#%#$#######D###%###########%#$#$#$#'###$###(## ###&###+###R#-#$###$###4#$#$###)###.###/#-#:###-###<#.#7#$#-#$#;###$#+#8#%#+#&#:#$#$#+#####4#%#,#&#;###&#(#6#&#+#(#9###(#'#6#%#-#'#9#########$#&#%#4#'#,#'#8###&#*#5#(#*#)#7###'#)#4#)#*#)#####5###+#%#4#*#####(#&#9###,#$#2#-#####+###7###-#$#3#-#####@###-#$#2#.#.#########$#0###,#%#1#.#1#'#.###.#$#1#-#&###-#(#,###)#*#####/#,#####)###)#(#,###+#(#1#4#,#)#)#$#,#'#0#6#-#)#'###+###$#&#0#7#.#%#(###)#%#'#$#0#7#6###*#&#&#$#1#5#####4#$#*#,#1#5#6###/#(#1#5#&#%#'###%###$###1#(#####/#3#%#(#$###)###$#)#)#'#3#<#+#$#&#(#(#&#####2#>#'###%###&#(#(##"
 if n == 5: return b" #######'###'###(#,#&###&###$#'#*###*###&#'#)###,#.###$#,#(#$###.###'#####$#%###0#-#+###&#(#5#########$#%###0#-#,###$#)#0#######$#####&#3#.#,#$###)#2###$#####&#####1#.#-#####)#/###+#$#2#/#.#*#3###%#####$#1#0#.#*#3###%#&#1#1#-#*#8#%#0#2#-#*#5###%#$#0#3#-#)#2###%###$#$#-#####5#,#)#2###$###$#%#/#3#/#&#9#&#.#3#$#$#D#####$###$#.#2#$#####$#F#&#.#1#(###>###(#####%#.#0#####(###G#%#,#0#(#$#G#&#-#8#########B###$#$#-#<#?###'#$#-#?#A#%#-#@#=###$#%#-#A#>#####$#-#B#,#$#2#%#.#A#+#&#.###$#&#-#A#+#'#*###$###$#%#####,#@#$###)#(#-#'#/#>#.#)#)#########$ ###$###)###)#F#4#$#3#G#4#$#2#I#3#$#1#J#3#$#0#K#3#$#0#K#3#$#/#M#2#$#.#O#1#$#*###%#O#1#$#-#N#3#$#-#N#3#$#,#N#&#######-#$#,#N#'###.#$#,#L#&###%#######+#$#,#L#%###%###$###+#$#+#K#.###+#$#+#K#-###,#$#+#I#$#$#.###)#$#*#H#-###0#$#*#F#####/#$#-#$#*#S#)#####$#&#$#*#W#$#$#)#$#*$(#&#$#*$'#####%#$#*$+###$#*$.#*$.#*$-"

w,h = 74,28
r = 320 // w
COUL = [(0,0,0),(255,255,255)]

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,50+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
  while True: 
    k = (k + sens) % 5
    if k == 0: sleep(1)    
    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(.2)
     else:
         t = taille(img[i:i+2])
         x,y = remplir(x,y,t,COUL[c])
         i += 2
         c = 1 - c
    sleep(.2)

fill_rect(0,0,320,222,(0,0,0))
aff()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.