From 9b0b20f7a5737decddc9e4a7eea2dddc0b7f78b8 Mon Sep 17 00:00:00 2001 From: Manuel Bucher <manuel.bucher@hu-berlin.de> Date: Sun, 24 Jun 2018 13:00:55 +0200 Subject: [PATCH] Removed debug prints --- loesung.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/loesung.c b/loesung.c index fb46a70..c319c2a 100755 --- a/loesung.c +++ b/loesung.c @@ -209,22 +209,6 @@ int field_neighbours(Field *this) { return 0; } -void field_print(Field *this) { - printf("[\n"); - Tile *t = this->tiles; - for (uint32_t i = 1; i < this->num_tiles; i++){ - printf("\t(%u %u): {", t[i].x, this->tiles[i].y); - for (int j = 0; j < 4; j++) { - if(t[i].neigh[j] != 0) { - Tile *neigh = &t[t[i].neigh[j]]; - printf(" (%u %u)", neigh->x, neigh->y); - } - } - printf(" }\n"); - } - printf("]\n"); -} - /********** Schlange von Tiles **********/ typedef struct Queue { Tile *p_first; @@ -318,14 +302,13 @@ bool hk_dfs(Field *this, uint32_t e) { void hk_print(Field *this) { Tile *t = this->tiles; - /*for (uint32_t i = 1; i < this->num_tiles; i++) { + for (uint32_t i = 1; i < this->num_tiles; i++) { uint32_t p = t[i].pair; - printf("%u: %u %u;%u %u\n", i, t[i].x, t[i].y, t[p].x, t[p].y); if (this->tiles[i].pair == 0) { printf("None\n"); return; } - }*/ + } for (uint32_t i = 1; i < this->num_tiles; i++) { if (!tile_odd(&t[i])) continue; @@ -361,17 +344,16 @@ int main() { fprintf(stderr, "Error: Duplicated entry\n"); // Duplikat exisitert break; } - //field_print(&f); if (f.num_tiles - f.num_odd == f.num_odd) { printf("None\n"); - fprintf(stderr, "Ungleiche Knotenbelegung"); break; } hk(&f); // Algorithmus von Hopcroft und Karp result = EXIT_SUCCESS; break; case ReadEof: result = EXIT_SUCCESS; break; + // Fehlerausgabe case ReadErrOverflow: fprintf(stderr, "%u: too big integer\n", f.num_tiles); break; case ReadErrInvalidChar: fprintf(stderr, "%u: invalid character\n", f.num_tiles); break; case ReadErrTooFewNumbers: fprintf(stderr, "%u: too few numbers\n", f.num_tiles); break; -- GitLab