home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume13 / perp / part01 / obfus.c < prev    next >
C/C++ Source or Header  |  1992-08-03  |  2KB  |  30 lines

  1. #include <curses.h>
  2. #define R break
  3. #define U M[h][f]
  4. #define W M[g][e]
  5. #define T M[y][x]
  6. #define B(a) "A"#a"A",
  7. #define A "AAAAAAAAAAAAAAAAAAAAAA"
  8. #define z(a) case a:if(U=='B')U=W,x=e,y=g,u--;
  9. #define Z(a,b) else if(U==a&&d==b)U=W='B';R;
  10. #define K(a) a##a##a
  11. #define k(a) #a#a#a#a#a#a"\0"
  12. #define V "      \0"
  13. #define S " \0/----\\\0_/  \\_"
  14. int u=484,X[]={-1,0,0,1},Y[]={0,1,-1,0},x,y,D,i,j,a;char o,m,*t,*O="MNOH"
  15. ,*k="hjkl",*s=K(k(#))V V V"  ___ \0 /   \\\0 \\___/\0  ___ \0 /@@@\\\0 \
  16. \\@@@/\0| | /\\\0----||\0    \\/\0  /--\\\0   \\/ \0 ==|  \0 ==|  \0  \
  17.  /\\ \0  \\--/\0 /O__o\0 \\___/\0 /_\\_ \0"K("  <<  \0")V k(v)V V k(^)V
  18. "  /\\  \0 <  > \0  \\/  \0o__O\\ \0\\___/ \0 _/_\\ \0 O__O"S"\0 ^__^"S,
  19. M[12][22]={A,B(LCABBBBBBBABBCBBCABB)B(CCABAKAAABAFBABABAEB
  20. )B(BBBBABBIBBBBBEEABACL)B(CCBNIBBAAAAGALBBBABC)B(AAAAAAJACBABBCABAABC
  21. )B(LLAACCBACBAAALLCABBB)B(BDLAAABABCAAAALCABBL)B(BCBIBBBBBBBBAAAAACBB
  22. )B(BCCAABBADBBBBDBDBDBC)B(LBBACCCCDBCABBBDBBBB)A};main(){initscr();clear();
  23. noecho();cbreak();x=y=4;D=39,o='M';m=T;while(D&&u){for(i=j=a=0;j<7;!(mvaddstr(
  24. j*3+a,i*6,s+(((M[((y-1)/5)*5+j][((x-1)/10)*10+i]-'A')*3+a++)*7)),a^3)&&(a=0,!
  25. (++i^12))&&(a=i=0,j++));refresh();T='B';if(t=(char*)strchr(k,getch())){int e=
  26. x,g=y,f=x,h=y,d=t-k;o=O[d];f=(e=x+X[d])+d[X];h=(g=y+Y[d])+d[Y];switch(W){case
  27. 'B':x=e;y=g,u--;R;z('C')else if(U=='C')U=W='L';R;z('D')R;case'L':x=e;y=g,u--;D
  28. --;R;z('E')Z('I',0)z('F')Z('J',1)z('G')Z('K',2)}}m=T;T=o;}clear();mvaddstr(12
  29. ,31,u?"Well done!":"Too many moves");move(23,0);refresh();endwin();return 0;}
  30.