LUCK, day 2 of 1

So, I decided to do further work on my entry for the rgrd First <1KbRL Challenge.

  • Line of Sight (Kind of)
  • Solid cells
  • Themed Levels (:P)
  • Level borders
  • Ensured stairs and artifacts are reachable

You can download it here


LUCK 2.0, Source Code Included
LUCK 2.0, Source Code Included

Source Code

import sz.csi.jcurses.*;public class C{int xr,yr,xp,yp,q,w,xo,yo,v,r,i,e=500;
boolean m[][]=new boolean[20][20];int r(){return(int)(Math.random()*17+1);}
void a(int x,int y,String h){p(x,y,Math.abs(xp-x)+Math.abs(yp-y)<7?h:" ",1+
(int)(v/2.0d));}void j(int x,int y){if(!m[xp+x][yp+y]){xp+=x;yp+=y;}}public
static void main(String[]p){new C();}public C(){for(;i<20;i++){m[r()][r()]=
xr][yr]?"#":".");}p(2,22,"LUCK! Slash > L"+v+" E"+e+" R"+r+" ",7);p(xp,yp,
"@",12);a(q,w,">");a(xo,yo,")");switch(c.inkey().code){case 112:j(0,-1);
break;case 108:j(0,1);break;case 90:j(-1,0);break;case 93:j(1,0);break;case
40:break o;}if(--e==0)break o;if(v==21){if(r>=10)p(2,23,"WON "+(r-10),4);
break o;}}}JCursesConsoleInterface c=new JCursesConsoleInterface();void p(int
x,int y,String m,int o){c.print(x,y,m,o);}}


Aprox. Work Time: 6:00 (3:00+3:00)
Source Files: 1
LOC: 1
SLOC-L: 15

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s