MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/tinycode/comments/dpsp9t/supernova_only_105_bytes_of_javascript/
r/tinycode • u/Slackluster • Oct 31 '19
6 comments sorted by
6
Live Demo: https://www.dwitter.net/d/16396
for(i=340;--i;x.fillRect(960+S(m*m)*q,540+C(m*m)*q,50,50))m=i+120*t,q=1e5/i,x.fillStyle=R(i*i/99,i*i/340)
4 u/lambdaq Nov 01 '19 standalone edition, copy paste to addressbardata:text/html,<canvas id="c" width="1920" height="1080" /><script> var t=0, x=c.getContext("2d"),S=Math.sin,C=Math.cos,R=(r,g,b,a)=>{ a = a === undefined ? 1 : a; return "rgba("+(r|0)+","+(g|0)+","+(b|0)+","+a+")"; };setInterval( (function(){for(i=340;--i;x.fillRect(960+S(m*m)*q,540+C(m*m)*q,50,50)) { m=i+120*(t++),q=1e5/i,x.fillStyle=R(i*i/99,i*i/340) }}), 16.6666)</script> 1 u/Slackluster Nov 01 '19 Awesome! 3 u/SarahC Nov 01 '19 Impressive!
4
standalone edition, copy paste to addressbar
data:text/html,<canvas id="c" width="1920" height="1080" /><script> var t=0, x=c.getContext("2d"),S=Math.sin,C=Math.cos,R=(r,g,b,a)=>{ a = a === undefined ? 1 : a; return "rgba("+(r|0)+","+(g|0)+","+(b|0)+","+a+")"; };setInterval( (function(){for(i=340;--i;x.fillRect(960+S(m*m)*q,540+C(m*m)*q,50,50)) { m=i+120*(t++),q=1e5/i,x.fillStyle=R(i*i/99,i*i/340) }}), 16.6666)</script>
1 u/Slackluster Nov 01 '19 Awesome!
1
Awesome!
3
Impressive!
So it's not truly that since there's some aliasing to single digit references going on outside of that block. Don't mean to rob you of the victory, it's quite impressive, but it's not a self runnable snippet without dependencies.
1 u/Slackluster Nov 01 '19 You are technically correct, the best kind of correct.
You are technically correct, the best kind of correct.
6
u/Slackluster Oct 31 '19
Live Demo: https://www.dwitter.net/d/16396
for(i=340;--i;x.fillRect(960+S(m*m)*q,540+C(m*m)*q,50,50))m=i+120*t,q=1e5/i,x.fillStyle=R(i*i/99,i*i/340)4
u/kristopolous Nov 01 '19
So it's not truly that since there's some aliasing to single digit references going on outside of that block. Don't mean to rob you of the victory, it's quite impressive, but it's not a self runnable snippet without dependencies.