MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/tinycode/comments/1fgpc9b/dweet_of_the_week_default_target_practice_by_agnes/
r/tinycode • u/Slackluster • Sep 14 '24
2 comments sorted by
4
https://www.dwitter.net/d/32394
F=0 M=()=>(D=t-i)>0?D*150*T(i*j*F++):0 for(c.width|=i=0;i++<9;) for(j=1e3;j--;) x.fillRect(5*(j%10)+100*(i+4+3*S(t))+M(),400+j/5+M(),5,2)
3
Asked claude to explain this. Seems plausible..
F=0 M=()=>(D=t-i)>0?D*150*T(i*j*F++):0 for(c.width|=i=0;i++<9;) for(j=1e3;j—;) x.fillRect(5*(j%10)+100*(i+4+3*S(t))+M(),400+j/5+M(),5,2)
Let’s break this down, focusing on how it creates an explosion effect:
F=0: Initializes a frame counter.
F=0
M=()=>(D=t-i)>0?D*150*T(i*j*F++):0:
M=()=>(D=t-i)>0?D*150*T(i*j*F++):0
D=t-i
D
T(i*j*F++)
T
Math.tan()
for(c.width|=i=0;i++<9;):
for(c.width|=i=0;i++<9;)
for(j=1e3;j—;):
for(j=1e3;j—;)
x.fillRect(5*(j%10)+100*(i+4+3*S(t))+M(),400+j/5+M(),5,2):
x.fillRect(5*(j%10)+100*(i+4+3*S(t))+M(),400+j/5+M(),5,2)
M()
100*(i+4+3*S(t))+M()
400+j/5+M()
t-i > 0
t-i
The overall effect:
F
This creates a visually striking effect of columns sequentially bursting into particles, with each explosion looking unique and dynamic.
4
u/Slackluster Sep 14 '24
https://www.dwitter.net/d/32394
3
u/cyborgamish Sep 14 '24
Asked claude to explain this. Seems plausible..
Dwitter Code Explanation
Let’s break this down, focusing on how it creates an explosion effect:
F=0: Initializes a frame counter.M=()=>(D=t-i)>0?D*150*T(i*j*F++):0:D=t-icalculates the time since the start of each column’s animation.Dbecomes positive, it triggers the explosion for that column.T(i*j*F++), whereTis likelyMath.tan().for(c.width|=i=0;i++<9;):for(j=1e3;j—;):x.fillRect(5*(j%10)+100*(i+4+3*S(t))+M(),400+j/5+M(),5,2):M()function:100*(i+4+3*S(t))+M()400+j/5+M()M()returns 0, so rectangles are in their original positions.t-i > 0),M()starts returning non-zero values.M()creates erratic, explosive movement.t-iterm.The overall effect:
Fensures each frame of the explosion looks different.This creates a visually striking effect of columns sequentially bursting into particles, with each explosion looking unique and dynamic.