Reminds me of the 1KBRL competition
import sz.csi.jcurses.*;class D{int a,b,c,d,k,l,o,p,q,w,v,r,i,e=600,f,h;boolean m[][];int r(){return(int)(Math.random()*17+1);}int[]s=new int[]{0,0,-1,1,-1,1,0,0};void a(int x,inty,char h){j.print(x,y,Math.abs(a-)+Math.abs(b-y)<7?h:' ',1+v%13);}public static void main(String[]p){new D();}D(){j.cls();for(;
{if(q==a&w==b){m=new boolean[20][20];for(i=0;++i<20;){m[r()][r()]=m[0]
=m[19]=m[0]=m[19]=true;}q=r();w=r();a=r();b=r();o=r();p=r();v++;m[q][w]=m- [p]=false;}if(o==a&p==b){o=40;p=3;r++;}d=-1;while(d++<19){c=-1;while(c++<19)a(c,d,m[c][d]?'#':'.');}j.print(2,22,"LCK L"+v+"E"+e+"R"+r+" ,7);j.print(a,b,"@",12);a(q,w,'>');a(o,p,'%');a(k,l,'&');i=j.inkey().code;d=s[i%4];c=s[4+i%4];if(a+d==k&b+c==l){if(r()>{k=r();l=r();}}else if(!m[a+d][b+c]){a+=d;b+=c;}f=Integer.signum(a-);h=Integer.signum(b-l);if(k+f==a&l+h==b)e-=5;else if(e%(5-(int)(v/4.5d))==0&!m[k+f][l+h]){k+=f;l+=h;}if(--e<0|v>20)break;}j.print(2,23,r>9?"WON":"DIE",4);j.waitKey(40);}JCursesConsoleInterface j=newJCursesConsoleInterface();}
#include<stdlib.h>
#define F(n)for(j=0;j<n;j++)
#define r rand()
int main(){int x,s=46,n,i,j,z=77,l[z];char m[z*s],h[z];initscr();raw();F(z*s)j[m]=35;F(s)for(j[l]=i=(r%4+3)*z+(n=r%17*z+r%s+z);n<=i;n+=z)for(x=n;x<=n+j/2;m[++x]=s);F(9)l[j][m]=z,j[h]=2;m[*l]=64;*h=5;l[j][m]=62;F(z)x=n=l[i++,i%=9];if(i)!i[h]||*l^(n+=r%3+r%3*z+~z)||--*h?0:abort();else{F(25)mvaddnstr(j,i,m+j*z,z);j=s-getch();m[n+=j/3*z-j%3+153]^62||main();F(9)l[j+1]^n||--h[j+1]||n[m]--;}n[m]^s||m[l=n]=x[m],x[m]=s);}}