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