#include #include #define P(A,B,C,D,E) mvaddch(b+A,a+B,(q[y]&C)?D:E); #define O(A,B,C) case A:if(q[x]&B)C;break; #define R rand() #define U 0,1,4,5 #define J(x) (1<=0)&&(x+u[d]<343)){if(!q[x +u[d]]){q[x]+=J(d);x+=u[d];q[x]+=J(5-d );l--;}else if(R0){move(J(0),60);printw("Level %d",( x/0x31)+J(0)); q[x]|=J(J(3));for(y=(x/ 0x31)*0x31;y<(J(0)+x/0x31)*0x31;y++)if (q[y]&J(J(3))){a=J(0)+(3*((y/7)%7));b= J(0)+(3* (y% 7)); mvaddch( J(1)+((y %7)*3),J (1)+(((y /7)%7)*3 ),V);P(0 ,0,0,0,j )P(3,0,0 ,0,j)P(0,3,0,0,j)P(3,3,0,0,j)P(0,J(0), J(0),V,j)P(0,J(1),J(0),V,j)P(J(0),3,J( 1),V,j)P(J(1),3,J(1),V,j)P(J(1),J(0),4 ,'U',V)P(J(1),J(1),J(3),'D',V)P(J(0),0 ,J(4),V, j)P(J(1) ,0,J(4), V,j)P(3, J(0),J(5 ),V,j)P( 3,J(1),J( 5),V, j)} mvaddch(J (1)+((x%7 )*3),J(1) +(((x/7)% 7)*3),'@') ;refresh() ;switch(getchar()){O('k',J(0), x--)O('j',J(5),x++)O('l',J (1),x+=J(3)-J(0))O('h' ,J(4),x-=7)O('u',4 ,(x+=49, clear()))O('d',8,(x-=49,clear ()))case 'q':x=-1;break;}}clear();refresh (/*v*/); nocrmode ();echo();endwin();if(! x)printf ("You Escaped!\n");exit(0);} Best Game: Don Dodson Don Dodson AG Communication Systems 4101 W Union Hills Dr #1104 Glendale, AZ 85308 USA Judges' comments: To use: make dodsond2 Try: dodsond2 An amazing entry! The official chef enjoyed solving the maze, which she did on the first attempt. Selected notes from the author: Interactive 3D Maze Step into a randomly generated 3D maze and try to get out alive! Use the vi movement keys (hjkl) to move on a level, and u or d to move (u)p or (d)own from a position with a U or D on the map. To simulate the feeling of being in an unknown labyrinth, areas which you have not visited cannot be seen. Reach the north-west left corner of level 1 to exit.