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