fork download
  1. #include <stdio.h>
  2. #define W 8
  3. #define H 6
  4. char map[H][W]={
  5. {1,1,1,1,1,1,1,1},
  6. {1,0,0,0,0,0,0,1},
  7. {1,0,1,1,1,0,1,1},
  8. {1,0,0,0,0,1,0,1},
  9. {1,0,0,1,0,0,2,1},
  10. {1,1,1,1,1,1,1,1},
  11. };
  12. void maze0(int x, int y, int depth){
  13. int i;
  14. for(i=0;i<depth;i++){
  15. printf(" ");
  16. }
  17. if(map[y][x]==0){
  18. printf("(%d,%d)\n", x,y);
  19. }
  20. else if(map[y][x]==1){
  21. printf("(%d,%d)X\n", x,y);
  22. }
  23. else if(map[y][x]==2){
  24. printf("(%d,%d)OK\n", x,y);
  25. }
  26. }
  27. int main(void) {
  28. maze0(2,1,3);
  29. return 0;
  30. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
      (2,1)