Skip to content

Instantly share code, notes, and snippets.

@moriyoshi
Created October 28, 2010 07:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save moriyoshi/650869 to your computer and use it in GitHub Desktop.
Save moriyoshi/650869 to your computer and use it in GitHub Desktop.
javascript:(function(d,g,r,o,l,x,y,u,z,t,a,b,n,m,s,i,f){n=d.createElement("pre");n.setAttribute("style","z-index:100;font-weight:bold;position:absolute;left:0px;top:0px;background:black;color:white");s=new Array(o+1).join(" ");for(i=0;i<l;i++)n.appendChild(m=r[i]=d.createTextNode(s)),n.appendChild(d.createTextNode("\n"));function p(x,y,c,_){if(x>=0)with(r[y])nodeValue=nodeValue.substring(0,x)+c+nodeValue.substring(x+c.length)}function h(){t.push({x:0,y:8,s:"Python",c:0,m:function(){with(this)x+=c>40?-3:1,y+=c>40?1:0,c++;return this.c<40||this.x>3&&this.y<l}})}a=x,b=y,f=0,setInterval(function(i,j,k,e){Math.random()>.97?h():0;for(i=0;++i<4;)p(0,l-i,s);p(x,y," ");for(i=0;i<3;++i)for(k=g[i].length,j=0;j<o;j+=k)p(j,l-i-1,o-j<k?g[i].substr(f,o-j):g[i].substr(f,k)+g[i].substr(0,f));f=(--f+k)%k;for(i=u.length;--i>=0;)with(u[i])p(x--,y," "),x>0?p(x,y,"-"):u.splice(i,1);x=a,y=b,p(x,y,"<?php");for(i=t.length;--i>=0;)e=t[i],p(e.x,e.y,s.substr(0,e.s.length)),e.m()?p(e.x,e.y,e.s):t.splice(i,1)},50);d.onkeydown=function(e){switch(e.keyCode){case 90:a=x>0?x-1:x;break;case 83:b=y>0?y-1:0;break;case 67:a=x<o-5?x+1:x;break;case 88:b=y<l-1?y+1:y;break;case 32:u.push({x:x-1,y:y});break}return false;};d.body.appendChild(n);})(document,["/ \\ \\/ \\ \\"," _/ \\/ \\_/\\ /\\_/ \\/\\ "," /\\ /\\ /\\ "],[],80,25,75,10,[],[],[])
/* zで左、cで右、sで上、xで下、スペースでビーム */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment