Skip to content

Instantly share code, notes, and snippets.

View rogerkenny's full-sized avatar

Roger Kenny rogerkenny

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@rogerkenny
rogerkenny / c64_bash_prompt
Created December 5, 2015 08:33
Commodore 64 prompt for your bash terminal
export PS1="\n **** \h \u \s V\v \@ **** \n \w\n\nREADY.\n"
//252
var m=100,d=document,i=function(x,y,g,h,j){return(x*x+y*y<4&&j<m)?i(x*x-y*y+g,2*x*y+h,g,h,++j):(j<m)?'#fff':'#000';},k,l=-1,s=0.02;do{l=l+s;k=-2;do{k=k+s/2;d.write('<b style="color:'+i(0,0,k,l,1)+';">#</b>');}while(k<=0.8);d.write('<br>')}while(l<=1);
//190
var o='',l=-1,s=0.02;function i(x,y,g,h,j){return(x*x+y*y<4&&j)?i(x*x-y*y+g,2*x*y+h,g,h,--j):j?'#':'_'};while((l+=s)<1){k=-2;while((k+=s/2)<1){o+=i(0,0,k,l,99)};o+='<br>'};document.write(o)
//174
o='',l=-1,s=0.02;function i(x,y,j){return(x*x+y*y<4&&j)?i(x*x-y*y+k,2*x*y+l,--j):j?'#':'_'};while((l+=s)<1){k=-2;while((k+=s/2)<1){o+=i(0,0,99)};o+='<br>'};document.write(o)
@rogerkenny
rogerkenny / 252CharacterMandelbrot.js
Created October 19, 2015 02:32
First step toward a tweetable Mandelbrot.
var m=100,d=document,i=function(x,y,g,h,j){return(x*x+y*y<4&&j<m)?i(x*x-y*y+g,2*x*y+h,g,h,++j):(j<m)?'#fff':'#000';},k,l=-1,s=0.02;do{l=l+s;k=-2;do{k=k+s/2;d.write('<b style="color:'+i(0,0,k,l,1)+';">#</b>');}while(k<=0.8);d.write('<br>')}while(l<=1);
@rogerkenny
rogerkenny / 135CharacterMandelbrot.js
Last active February 22, 2016 17:34
I challenged myself to write a tweetable one-line Mandelbrot set, and this is the result. 135 characters long, generates an ascii art Mandelbrot.
o='',s=0.02;for(l=-1;(l+=s)<1;){for(k=-2;(k+=s)<1;){for(x=y=0,j=99;x*x+y*y<4&&--j;){a=x*x-y*y+k,y=2*x*y+l,x=a}o+=j?'#':'_'}o+='<br>'};
document.write(o);document.getElementsByTagName('html')[0].style.lineHeight = 0.5;