0 0023.0 3. 9.8__auto_type // Avoid visiting visited nodes(endless loop occurs) if (visited[my][mx]) { return ; } visited[my][mx] = true; 31 7 // Stop if drafty or wall. Increment counter if gold is found. if (c == '#') { return ; } if(c == 'T'){ return ; = 0 // printf("x: %d, y: %d, c: %c\n", mx, my, c); if (c == 'G') { counter++; } // Move (as long as we're not stepping out of bounds) if (mx < w) { move(mx+1, my, w, h); //Right } if (my < h) { move(mx, my+1, w, h); // Up } if (mx > 0) { move(mx-1, my, w, h); //Left } if (my > 0) { move(mx, my-1, w, h); // Down } return ; } int main(int argc, char **argv) { int w, h; scanf("%d %d", &w, &h); int px, py; // Populate map for (int i=0; i