

Tetris in 3 lines of MSX Basic - bane
http://nsg.upor.net/msx/basic/tritris.htm

======
knacks
And in 652 characters in JavaScript:
[http://copy.sh/tetris/](http://copy.sh/tetris/)

    
    
        f=[];p=[1];g=h=2;s=0;t=500;for(i=0;23>i;i++)f[i]=j=-16380;
        f[23]=-1;onkeydown=e;e(e);function e(b,a){(k=b.which)?k-38
        ?k&-3^37||(g+=a=k^37?-1:1):(z=p,v=p[2],c=p[1],p=[2*v&2|4*c
        &4,p[3]/2&1|v&2|2*c&4|4*p[0]&8,p[3]/4&1|v/2&2|c&4|2*p[0]&8
        ,v/4&2|c/2&4]):s-j&&setTimeout(e,100+t,h++);m=p[0]<<g;l=p[
        1]<<g;_=p[2]<<g;o=p[3]<<g;f[h+=32==k]&m|f[1+h]&l|f[2+h]&_|
        f[3+h]&o?a?g-=a:k^38?(f[h]|=l,f[--h]|=m,f[2+h]|=_,f[3+h]|=
        o,h?(g=6,x=new Date%7*4,p=[h=0,2908739>>x&15,266758006>>x&
        15],t*=.97):s+=" Game Over!"):p=z:k^32||e(b);for(y=_=o="";
        24>++y;o+="\n")for(f[y]+4||(f.splice(y,1),f.unshift(j),s+=
        ++_,o="",y=2),x=14;x;q.textContent=o+s)o+=" X"[(f[y]|p[y-h
        ]<<g)>>x--&1]}

------
gress
False title. The Tetris is not written in basic. It's written in Assembler,
and then basic is used to load the binary into memory.

~~~
TheLoneWolfling
On the one hand, I get what you're saying. On the other hand, I disagree with
what you're saying.

Ultimately, I disagree. The platform is well-defined, and as MSX Basic has
faculties for loading machine code... It makes sense.

The bigger problem is that it's not even actually tetris.

~~~
gress
Are you really defending the idea that the Tetris is written in basic? Even
the author says it's written in assembler. It's just the title that is
misleading.

