Mandelbrot
rotozoom
Many people did fractals renderers in Javasript in 256 bytes, but no one ever made one that zooms and rotate... until today.
Source code
<pre id=B><script>setInterval("for(d='p01?*?:,~.????',C=Math.cos(n-=88),S=Math.sin(n),Y=m=1+C,z=2048;z;Y-=m/16)for(d+='<br>',X=m;--z&63;X-=m/32,d+=d.charAt(k))for(r=i=k=0;++k+r*r+i*i<13;i=t)t=2*r*i-X*C+Y*S,r=r*r-i*i-X*S-Y*C+C-1;B.innerHTML=d",n=9)</script>
Exactly 256 bytes.
And here is a slightly beautified version of the render loop
for(d='p01?*?:,~.????',C=Math.cos(n-=88),S=Math.sin(n),Y=m=1+C,z=2048;z;Y-=m/16)
for(d+='<br>',X=m;--z&63;X-=m/32,d+=d.charAt(k))
for(r=i=k=0;++k+r*r+i*i<13;i=t)
t=2*r*i-X*C+Y*S,
r=r*r-i*i-X*S-Y*C+C-1;
B.innerHTML=d
Not much magic going here. It is rather straight forward implementation of a Mandelbrot fractal renderer with zoom and rotation of the viewport.
Many bytes were wasted to make sure this effect works cross browser.
The one trick I like here and reused many times was to have one line with some kind credits that also serves as a look up table to render the frames.
Feedback
You can find mandelbrot rotozoom on Pouet.net were it was well received after all. However it was my first tiny prod in JavaScript since the 256b.htm contest, and I had a hard time to please every one. On the other hand I learnt some valuable lessons.
Other recent experiments
There are many experiments and projects like MANDELBROT
ROTOZOOM to discover other here.
🏄♀️ 1KB QUINE
FLUID SIMULATION
Homage to the Fluid Simulation by Yusuke Endoh for IOCCC 2012, in 1kb of HTML, CSS and Javascript quine, code-golfed by Xem , Aemkei, RReverser and Irratix and myself
MONOSPACE
MONOSPACE: Flip dots with feelings, a JavaScript demo in 1021 bytes, winner of the 1024 bytes demo competition at Assembly 2020.
👩🌾 256B
MUSIC VIDEO
Music video with Speech synthesis, Web Audio music and animated visuals about a woman farmer in 255 bytes of HTML+Javascript
CODING⯌ART
AT RENDER
CODING⯌ART at Render 2017 was part of my series of talks + live coding aiming to inspire new web developer artists.
10 PRINT THEREMIN
AT WEB REBELS
A lighting talk about labyrinth generation and theremin instrument using the Web Audio API in 219 bytes presented at Web Rebels 2016.
MINICRAFT
Tribute to MINECRAFT, voxel flyby in 252 bytes of HTML5
JAVASCRIPT
IS JARIG
Javascript is 18 years old! Let's celebrate with a nice little tune.
ASAHIKAWA
Flyby the city of Asahikawa in 64 bytes.
TERRA
A voxel landscape rendered using a plasma in a valid 480bytes Atari bootsector. TERRA ranked #2 at Outline 2006
Let's talk
Don't be shy; get in touch by mail , twitter , github , linkedin or pouet if you have any questions, feedback, speaking, workshop or performance opportunity.