121 printf("%c", Temp.ManMoves[j][i]); |
121 printf("%c", Temp.ManMoves[j][i]); |
122 printf("\n"); |
122 printf("\n"); |
123 } |
123 } |
124 #endif |
124 #endif |
125 |
125 |
126 printf("Man is at (%i,%i)\n", Temp.Man.x, Temp.Man.y); |
126 fprintf(stderr,"Man is at (%i,%i)\n", Temp.Man.x, Temp.Man.y); |
127 printf("Platforms: %i, BoxesInPlatform: %i\n", Temp.NumPlatforms, |
127 fprintf(stderr,"Platforms: %i, BoxesInPlatform: %i\n", Temp.NumPlatforms, |
128 Temp.NumBoxesInPlatform); |
128 Temp.NumBoxesInPlatform); |
129 |
129 |
130 } |
130 } |
131 |
131 |
132 void PrintMove(const struct BoxMove b) |
132 void PrintMove(const struct BoxMove b) |
133 { |
133 { |
134 printf("Box: %i, Direction: {%i,%i}\n", b.box, b.dir.x, b.dir.y); |
134 fprintf(stderr,"Box: %i, Direction: {%i,%i}\n", b.box, b.dir.x, b.dir.y); |
135 } |
135 } |
136 |
136 |
137 static void show_percent_callback(const int parameter) |
137 void show_percent_and_map() |
138 { |
138 { |
139 fprintf(stderr, "Percent: %2.12f, depth: %i-%i\n", percent_to_show, |
139 fprintf(stderr, "Percent: %2.12f, depth: %i-%i\n", percent_to_show, |
140 min_depth_period, max_depth_period); |
140 min_depth_period, max_depth_period); |
141 ShowMap(actual_map); |
141 ShowMap(actual_map); |
142 fflush(stderr); |
142 fflush(stderr); |
143 min_depth_period = MAX_STEPS; |
143 min_depth_period = MAX_STEPS; |
144 max_depth_period = 0; |
144 max_depth_period = 0; |
145 #ifndef DEBUG |
145 } |
|
146 |
|
147 static void show_percent_callback(const int parameter) |
|
148 { |
|
149 show_percent_and_map(); |
146 alarm(ALARM_SECONDS); |
150 alarm(ALARM_SECONDS); |
147 #endif |
|
148 } |
151 } |
149 |
152 |
150 static void program_alarm() |
153 static void program_alarm() |
151 { |
154 { |
152 struct sigaction my_action; |
155 struct sigaction my_action; |