This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| freq = 770; len = 10; rate = 44100; vol = 1.0; | |
| start = new Date(); | |
| w = ''; | |
| phase = 0; | |
| sin = Math.sin; | |
| chr = String.fromCharCode; | |
| total = len*rate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function PickNumbers(count, total){ | |
| var i, set = [], | |
| result = []; | |
| for(i=total; i--;) | |
| set.push(i); | |
| for(i=count; i--;){ | |
| var picked = (Math.random() * set.length) | 0; | |
| result.push(set[picked]); | |
| set.splice(picked,1); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| if( typeof Object.create !== 'function' ){ | |
| Object.create = function(o){ | |
| var F = function( ){}; | |
| F.prototype = o; | |
| return new F(); | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function CollisionContoller(width, height) { | |
| this.draw = function(){ | |
| document.write("drawing\n"); | |
| }; | |
| }; | |
| CollisionContoller.prototype.registerPlanet = function(image, position, type){ | |
| this.draw(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /////// | |
| // Warning, code untested | |
| /////// | |
| type Thinger interface { | |
| SomeMethod( arg bool ) bool | |
| } | |
| type RealThing struct { | |
| state bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://www.reddit.com/r/programming/comments/lrg7f/experimental_images_from_very_short_programs/ | |
| function start() { | |
| var t = pt = 0; | |
| clearTimeout(timer); | |
| var func = ""+ | |
| "function animate() {" + | |
| " var x = y = pi = 0, W = w, S = size; " + | |
| " for (var i = 0; i < S;) { " + | |
| " img.data[i] = <code>; i++; t++; " + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <meta charset=utf-8 /> | |
| <title>Hello World</title> | |
| <style> | |
| body { margin: 30px auto; width: 500px; } | |
| header { font-size: 20px; padding-bottom: 10px; } | |
| article { padding : 20px; } | |
| footer { font-size: 10px;} | |
| #magic value { font-size: 10px;} | |
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| daytime. | |
| clear_skies. | |
| % I want to have empty tables (facts) `daytime` and `clear_skies` | |
| round(earth). | |
| round(ball). | |
| small(mouse). | |
| small(ball). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Packed with http://iteral.com/jscrush/ 1216B --> 955B | |
| from 1216B | |
| O=a.getImageData(0,0,c.height=f=W=256,f);U=O.data;D={};F=[];function J(p){p[5]=Q=0;for(j=3;j--;)if(!D[Q=(p[j]>>=2)+Q*f])D[Q]=F.push(p)}setInterval(function(){for(i=1e3;i--;){c=i%42*1.35;H=T;T=Math.random();A=H*2-1;B=T*2-1;J([Math.sin(H*7)*(o=13+5/(.2+Math.pow(T*4,4)))-T*50,T*550+500,(l=Math.cos(H*7))*o,(G=l/7+.5)-T/4,G]);if(A*A+B*B<1)if(c>32){J([(o=.5/(H+.01)-H*300)*Math.cos(n=(j=c&1)?6:4)+(w=T*-f)*Math.sin(n)+j*630-390,o*Math.sin(n)-w*Math.cos(n)+999-j*350,Math.cos(B+A)*99-j*50,(Math.pow(l=1-B*B,f*6)+Math.cos(H+T)+Math.pow(Math.cos((o*H+o+(B>0?w:-w))/25),30)*l-H+2)/5,o/1e3+.7-o*w/3e5]);J([(o=H*45-20)*Math.cos(l=c/.86)+(w=T*T)*f*Math.sin(l),Math.cos(B/2)*99-w*T*60+436,o*Math.sin(l)-w*f*Math.cos(l),w*.3+.3,T*.7])}else J([(o=A*(2-T)*(80-c*2))*Math.cos(c)-(w=99-Math.cos(A)*120-Math.cos(T)*(f-c*5)+Math.cos(Math.pow(1-T,7))*50+c*2)*Math.sin(c),(B*2-Math.cos(Math.pow(T,7))+9)*50,o*Math.sin(c)+w*Math.cos(c),1-T*.7,Math.pow(1-T,9)/4])}for(i=0;i<f*f;M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function newRandom(A,B,seed){ | |
| return function(){ | |
| seed = (A*seed+B)%(1<<31); return (seed >> 16) & 0x7fff | |
| } | |
| } | |
| r1 = newRandom(69069, 1, 0) | |
| r2 = newRandom(1103515245, 12345, 0) | |
| r3 = newRandom(214013, 2531011, 0) |
OlderNewer